2011-06-06 54 views

回答

38

我想我有一个更好的解决方案,

<header data-role ="header" data-theme="b"> 
    <h1 class="ui-title" role="heading">Staff</h1> 
    <div class="ui-btn-right" data-role="controlgroup" data-type="horizontal"> 
    <a href="#" data-role="button" data-icon="gear">filter</a> 
     <a href="#" data-role="button" data-icon="grid">move</a> 
    </div> 
</header> 

截图;

enter image description here

+0

你也可以只添加一个div:

...a elements here
! – 2015-02-20 17:52:23

1

没有,有2个硬限制,据我已经找到。我能够想出的最好的办法是获得另一个无风格的链接。然而,navbars - 在我的一个项目中,我需要在标题区域有一些按钮,我在它下面放置了一个导航栏,并且对结果感到满意。

他们在这里详细解释说:

http://jquerymobile.com/test/docs/toolbars/docs-navbar.html

2

我能够通过下面的代码来实现这一目标:

<div data-role ="header" data-theme="b"> 
<a href="#" data-role="button" data-theme="b" class="ui-btn-left" id="BackButtonHandler">Prev</a> 
<div data-role="controlgroup" data-type="horizontal" style="margin-left:75px;margin-top:5px;" > 
    <a href="index.html" data-role="button" data-icon="arrow-l" >P.Week</a> 
    <a href="index.html" data-role="button" data-icon="arrow-r" data-iconpos="right">N.Week</a> 
    </div> 
<a href="#" data-role="button" data-theme="b" class="ui-btn-right" id="BackButtonHandler">Next</a> 
</div> 
+0

这对RC的新版本无效:( – 2012-03-16 12:59:08

3

这可能帮助:

<div class="ui-btn-right"> 
    <!-- Home Button --> 
    <a href="index.html" data-role="button" 
     data-icon="refresh" data-iconpos="notext" data-direction="reverse" data-corners="true" 
     data-shadow="true" data-iconshadow="true" data-wrapperels="span" data-theme="b" title="Refresh"> 
    </a> 
    <!-- Home Button --> 
    <a href="index.html" data-role="button" 
     data-icon="home" data-iconpos="notext" data-direction="reverse" data-corners="true" 
     data-shadow="true" data-iconshadow="true" data-wrapperels="span" data-theme="b" title="Home"> 
    </a> 
</div> 

这给我那些漂亮的圆形按钮,两个并排在右侧。

就像在移动文档。

工程在1.1.1,没试过最新RC

+0

对不起,评论主页按钮,主页按钮,只是复制我的主页按钮两次,并更改图标 – mattdlockyer 2012-08-31 23:28:57

6

关于这个信息:
Device Widths
你可以在这里找到: http://www.metaltoad.com/sites/default/files/Responsive-Widths_0.png

multiple buttons jquery mobile header
您可以使用此代码:

<style type="text/css">    
    @media all{ 
     .my-header-grid.ui-grid-b .ui-block-a { width: 30%; } 
     .my-header-grid.ui-grid-b .ui-block-b { width: 40%; } 
     .my-header-grid.ui-grid-b .ui-block-c { width: 30%; } 
     } 
    }  
    </style> 
    <div class="my-header-grid ui-grid-b" data-theme="a"> 
     <div class="ui-block-a ui-bar-a" data-theme="a"> 
      <div align="left" style="padding-left:5px;padding-top:3px;height:33px;height:40px;"> 
       <a href="#" class="ui-btn-left" rel="external" data-mini="true" data-role="button" data-icon="back" data-theme="a">Back</a> 
       <a href="#" class="ui-btn-right" data-role="button" data-icon="gear" data-iconpos="notext">Edit</a> 
      </div> 
     </div> 
     <div class="ui-block-b ui-bar-a"> 
      <div align="center" style="padding-top:3px;height:33px;text-align:center;height:40px;"> 
      <div style="padding-top:7px;"> 
       <article role="heading" aria-level="1">expand </article> 
      </div> 
      </div> 
     </div> 
     <div class="ui-block-c ui-bar-a"> 
      <div align="right" style="padding-top:3px;height:33px;height:40px;"> 
      <a href="#" class="ui-btn-left" data-role="button" data-icon="plus" data-iconpos="notext">Add</a> 
      <a href="#" class="ui-btn-right" rel="external" data-mini="true" data-role="button" data-icon="refresh" data-theme="a">Refresh</a>       
      </div> 
     </div> 
    </div><!-- /grid-b --> 

如果任何机会你的编程无线th c#mvc razor引擎不要忘记用2 @就像所以@@ media一样编写css媒体标签,因为剃须刀引擎会将2 @视为一个整体。

你看,可与所有在这个环节这里显示的设计的玩法:
http://jsfiddle.net/yakirmanor/BAat8/


IV增加了一些联系,但我建议你会这样说的:
http://appcropolis.com/blog/advanced-customization-jquery-mobile-buttons/

简单着床是:

<header data-role ="header" data-theme="a"> 
     <a data-icon="back" href="/" rel="external">Back</a> 
     <h1 class="ui-title" role="heading">Staff</h1> 
     <a class="ui-btn-right" data-icon="back" href="#" rel="external">Refresh</a> 
    </header> 

或本:

<div data-role="header" data-theme="b"> 
     <a data-icon="back" href="/" rel="external">Back</a> 
     <h1 class="ui-title" role="heading">Staff</h1> 
     <div class="ui-btn-right" data-role="controlgroup" data-type="horizontal">   
      <a href="#" data-role="button" data-icon="gear">filter</a> 
      <a href="#" data-role="button" data-icon="grid">move</a> 
     </div> 
    </div> 

或本:

<div data-role="header" data-theme="e"> 
     <div class="ui-btn-left" data-role="controlgroup" data-type="horizontal"> 
      <a href="#" data-role="button" data-icon="gear">filter</a> 
      <a href="#" data-role="button" data-icon="grid">move</a> 
     </div> 
     <h1 class="ui-title" role="heading">Staff</h1> 
     <div class="ui-btn-right" data-role="controlgroup" data-type="horizontal"> 
      <a href="#" data-role="button" data-icon="gear">filter</a> 
      <a href="#" data-role="button" data-icon="grid">move</a> 
     </div> 
    </div> 

希望IV帮助。