如何在 jQuery Mobile 中以编程方式切换导航栏选项卡? [英] How do I programmatic toggle navbar tabs in jQuery Mobile?

查看:34
本文介绍了如何在 jQuery Mobile 中以编程方式切换导航栏选项卡?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 jQuery Mobile 中切换导航栏的界面,以便我可以按下 div 中的按钮并显示不同的导航栏?

How do I toggle the navbar's interface in jQuery Mobile so i can press a button in a div and display a different navbar?

推荐答案

jsFiddle Demo of jQuery Mobile NAV Toggle

我已经通过上面的链接创建了一个 jsFiddle Demo 来解决您的问题.

jsFiddle Demo of jQuery Mobile NAV Toggle

I have created a jsFiddle Demo via the link above that should address your question.

特别是,您可以轻松设置 NAV 栏,以及在不同栏之间切换.

In particular, you can set the NAV Bar easily as well as toggle it to and from different bars.

我说不同的栏是因为小提琴允许根据您的需要更多的 NAV 栏,并且非常容易适应.可以肯定的是,任何 NAV 栏maxs-out5 个按钮.

I say different bars because the fiddle allows for as many more NAV bars as you require, and is very easy to adapt. To be sure, any NAV bar maxs-out at 5 buttons.

编辑:根据您的消息评论,一旦创建了 1 个以上的页面,就可以轻松在页面之间导航.这个不同的 jsFiddle 展示了如何标记锚标签即时切换页面.此可以与原始 jsFiddle Answer 一起使用,以提供完整的解决方案.

Per your message comments, it's easy to navigate between pages once more than 1 page is created. This different jsFiddle shows how to label the anchor tags to switch pages on-the-fly. This can be used with the original jsFiddle Answer to provide a complete solution.


重新根据您最近的评论,这个 jsFiddle 允许在同一页面上切换按钮内容.


RE- Per your most recent comments, this new jsFiddle allows toggling of the buttons contents while on the same page.

提供简单的小提琴评论以了解正在发生的事情,但对任何不清楚的地方进行询问.

Provided are simple fiddle comments to understand what's going on, but ask about anything unclear.

这篇关于如何在 jQuery Mobile 中以编程方式切换导航栏选项卡?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆