在 jQueryMobile 中创建菜单的最佳方法是什么
我正在开发一个应用程序,其中包含一个带有指向多个页面的链接的菜单,我想知道实现它的最佳方法是什么。
一种解决方案是通过JavaScript在所有页面上创建菜单,但当它应该只对所有页面有一个全局菜单时,它会重复菜单。
另一个解决方案是在框架之外创建一个div,但这方式不会利用框架的任何功能。
I'm developing an application that contains a menu with links to the several pages and I would like to know what's the best way to implement it.
One solution is to create the menu on all pages via JavaScript, but it would duplicate menus when it should have just one global to all pages.
Another solution would be to create a div outside the framework but this way would not be taking any advantage of the features of the framework.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
目前版本的 jQueryMobile 1.0a4.1 是唯一的解决方案我发现正在 jQueryMobile 页面结构之外创建一个 div。
HTML:
CSS:
At the present version of jQueryMobile 1.0a4.1 the only solution I found was creating a div outside the jQueryMobile page structure.
HTML:
CSS:
我专门针对这个问题准备了这篇文章,它较少涉及固定页眉和页脚(因为我通常相信它们被误导,浪费了已经有限的房地产)以及更多关于处理全球导航的一般信息。希望这有帮助。
I prepared this post specifically for this question, It deals less with fixed headers and footers (since I generally believe them to be misguided wastes of already limited real estate) and more about dealing with global navigation in general. Hope this helps.
检查我正在编写的插件,名为 multiview。
它仍在进行中,但您可以通过将其放置在包装页面内但在您正在使用的任何面板之外来设置全局页眉/页脚。
让我知道这是否符合您的需求。我正在慢慢迈向错误修复阶段。
Check the plugin I'm writing, called multiview.
It's still work in progess, but you can set a global header/footer by placing it inside the wrapper page, but outside any panels you are using.
Let me know if this would fit your need. I'm slowly progressing towards bug-fixing stage.