通常,当您使用jQuery mobile创建一个data-role =“page”元素时,它将占用整个查看区域.因此,我不明白如何创建一个侧边栏.我想模拟以下内容,但是查看源代码并没有多大帮助:
http://jquerymobile.com/demos/1.0b1/docs/lists/index.html
请注意,当您单击列表中的项目时,它将变成侧边栏,并在主内容区域中显示另一个列表.此外,如果显示屏收缩足够,则仅显示主内容区域.是否有一个特殊的功能,在jQuery手机允许这个,还是有大量的不透明的javascript和CSS呢?
解决方法
查看beta Split View语法,您可以像这样控制“Sidebar”:
<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 -->
文件:http://jquerymobile.com/demos/1.0b1/(右键单击查看源代码)
相关CSS:http://jquerymobile.com/demos/1.0b1/docs/_assets/css/jqm-docs.css
讨论媒体查询(他们以前做过什么)的一个体面的ALA文章:http://www.alistapart.com/articles/responsive-web-design/