通常,当您使用 jQuery mobile 创建 data-role="page" 元素时,它会占据整个查看区域。因此,我不明白如何创建侧边栏。我想模拟以下内容,但查看源代码没有多大帮助:
http://jquerymobile.com/demos/1.0b1/docs/lists/index.html http://jquerymobile.com/demos/1.0b1/docs/lists/index.html
请注意,当您单击列表中的某个项目时,它会变成侧边栏并在主要内容区域中显示另一个列表。此外,如果显示缩小得足够多,它只会显示主要内容区域。 jQuery mobile 中是否有特殊功能允许这样做,或者其背后是否存在大量不透明的 javascript 和 CSS?
查看测试版分割视图语法,您可以像这样控制“侧边栏”:
<div data-role="page" id="jqm-home" class="type-home">
<div data-role="content">
<div class="content-secondary">
This would be the sidebar/split view on a tablet,
would show up stacked on a mobile device
</div><!-- end content-secondary -->
<div class="content-primary">
This is the main content.
If Tablet device this would be to the right of the above content,
if mobile this would be below the above content.
</div><!-- end content-primary -->
</div><!-- end content -->
</div><!-- end page -->
Docs: http://jquerymobile.com/demos/1.0b1/ http://jquerymobile.com/demos/1.0b1/(右键查看源码)
相关CSS:http://jquerymobile.com/demos/1.0b1/docs/_assets/css/jqm-docs.css http://jquerymobile.com/demos/1.0b1/docs/_assets/css/jqm-docs.css
一篇不错的 ALA 文章讨论了媒体查询(他们以前是这样做的):http://www.alistapart.com/articles/responsive-web-design/ http://www.alistapart.com/articles/responsive-web-design/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)