Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I programmatic toggle navbar tabs in jQuery Mobile?

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?

like image 317
Astronaut Avatar asked Jan 27 '26 10:01

Astronaut


1 Answers

jsFiddle Demo of jQuery Mobile NAV Toggle

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

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

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.

EDIT: 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.


RE-EDIT: 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.

like image 129
arttronics Avatar answered Jan 28 '26 22:01

arttronics



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!