jQuery Mobile - 页脚 - 导航栏 - 渲染时显示为三列两行网格布局
页面页脚添加为基于固定图标的导航栏。但在显示时,naevbar 转换为网格布局。即三列两行的网格布局。
我将以下脚本用于页脚 nevBar,
<div data-role="footer" class="nav-footer" data-position="fixed">
<div data-role="navbar" class="nav-footer" data-grid="d">
<ul>
<li><a href="#" id="home" data-icon="custom">H</a></li>
<li><a href="#" id="messages" data-icon="custom">M</a></li>
<li><a href="#" id="activities" data-icon="custom">A</a></li>
<li><a href="#" id="trackers" data-icon="custom">T</a></li>
<li><a href="#" id="settings" data-icon="custom">S</a></li>
</ul>
</div>
</div>
但它呈现如下。
<div class="nav-footer ui-bar-a ui-footer ui-footer-fixed fade ui-fixed-overlay" data-position="fixed" data-role="footer" role="contentinfo">
<div class="nav-footer ui-navbar" data-grid="d" data-role="navbar" role="navigation">
<ul class="ui-grid-b">
<li class="ui-block-a">XXX</div>
<li class="ui-block-b">...</div>
<li class="ui-block-c">...</div>
<li class="ui-block-a">...</div>
<li class="ui-block-b">...</div>
</ul>
</div>
</div>
各里内容如下。
XXX==>
<li class="ui-block-a">
<a id="home" class="ui-btn ui-btn-icon-top ui-btn-up-a" data-icon="custom" href="#" data-theme="a">
<span class="ui-btn-inner">
<span class="ui-icon ui-icon-custom"></span>
<span class="ui-btn-text">H</span>
</span>
</a>
</li>
我的输出显示为两行三列网格。请问您能找到原因吗?
The page footer added as fixed icon based navbar. but when it come to display, naevbar converted to a grid layout. that is, three columns and two rows grid layout.
Following script I have used for footer nevBar,
<div data-role="footer" class="nav-footer" data-position="fixed">
<div data-role="navbar" class="nav-footer" data-grid="d">
<ul>
<li><a href="#" id="home" data-icon="custom">H</a></li>
<li><a href="#" id="messages" data-icon="custom">M</a></li>
<li><a href="#" id="activities" data-icon="custom">A</a></li>
<li><a href="#" id="trackers" data-icon="custom">T</a></li>
<li><a href="#" id="settings" data-icon="custom">S</a></li>
</ul>
</div>
</div>
but it render as follows.
<div class="nav-footer ui-bar-a ui-footer ui-footer-fixed fade ui-fixed-overlay" data-position="fixed" data-role="footer" role="contentinfo">
<div class="nav-footer ui-navbar" data-grid="d" data-role="navbar" role="navigation">
<ul class="ui-grid-b">
<li class="ui-block-a">XXX</div>
<li class="ui-block-b">...</div>
<li class="ui-block-c">...</div>
<li class="ui-block-a">...</div>
<li class="ui-block-b">...</div>
</ul>
</div>
</div>
Content of each li as follows.
XXX ==>
<li class="ui-block-a">
<a id="home" class="ui-btn ui-btn-icon-top ui-btn-up-a" data-icon="custom" href="#" data-theme="a">
<span class="ui-btn-inner">
<span class="ui-icon ui-icon-custom"></span>
<span class="ui-btn-text">H</span>
</span>
</a>
</li>
My output shows as two rows and three colomns grid. Please can you find the reason.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看看这个: http://jquerymobile.com/test/docs/buttons/buttons -grouped.html
Check this out: http://jquerymobile.com/test/docs/buttons/buttons-grouped.html
您已经在 li 元素上指定了类来告诉您想要多少列,
我猜默认列数是三,这就是为什么最后两列被推到下一行的原因。
You have specify the classes on your li elements to tell how many columns you want
Default number of columns is three I guess, which is why the last two were pushed to the next row.