7

これは 1.1.0 ではコントロール グループを中央に配置するために機能していましたが、現在は 1.1.1 では機能していないようです。

<div data-theme="a" data-role="footer" style="text-align:center;">
   <div data-role="controlgroup" data-type="horizontal" data-mini="true">
      <a href="foo" data-role="button">link1</a>
      <a href="boo" data-role="button">link2</a>
   </div>
   <div class="copy">&copy; 2012 bigco</div>
</div>
4

4 に答える 4

5

このサイトで解決策を見つけました: http://forum.jquery.com/topic/how-to-horizo​​ntally-center-a-set-of-grouped-buttons

CSS:

#navgroup {text-align:center;}
#navgroup div {display:inline-block;}

HTML:

<div id="navgroup">
    <div data-role="controlgroup" data-type="horizontal">
      <a href="index.htm" data-role="button" data-theme="e" data-mini="true" class="active menu">Menu</a>
      <a href="specials.htm" data-role="button" data-theme="e" data-mini="true" class="specials">Specials</a>
      <a href="howitworks.htm" data-role="button" data-theme="e" data-mini="true" class="howitworks">FAQ</a>
      <a href="http://www.facebook.com" data-rel="external" data-role="button" data-theme="e" data-mini="true"  class="feedback">Facebook</a>
    </div>
</div>
于 2012-07-19T08:03:27.957 に答える
0

$( "selector")。show();を使用しても、問題は解決しません。'display:block'を適用するため、要素を表示します。

.show()を使用する代わりに、$( "selector")。css('display'、'inline-block');を使用するようになりました。

于 2012-07-20T18:08:27.847 に答える
0

今、私はJQM 1.2を使用していますが、これはうまくいきます...

CSS

.center-controlgroup { text-align: center; }

HTML

<div data-role="controlgroup" data-type="horizontal" class="center-controlgroup">...</div>
于 2012-11-30T01:41:10.820 に答える