Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

setting navicons as active on page load

Hello Lilian! I just tested with this code (on Page Show event):

var navbar = $("[data-role='navbar']:visible");
if($('.tg-state-persist', navbar).length == 0) {
$(".ui-btn-active", navbar).addClass('tg-state-persist');
} else {
$(".ui-btn-active", navbar).removeClass('ui-btn-active');
$(".tg-state-persist", navbar).addClass('ui-btn-active');
}

it works. I think you didn't set selected tab (as Max wrote). Please select MobileNavBarItem which you want to be highlighted and in Properties check "Active" checkbox.

Image

Kevin
Posts: 0
Joined: Sun Oct 07, 2012 7:58 pm

setting navicons as active on page load

Thanks for this Max. Worked out well for me.

Eric5020946
Posts: 0
Joined: Tue Sep 18, 2012 4:31 pm

setting navicons as active on page load

there is still a bug in tiggzi (or JQM), class are added in incorrect order "ui-btn-active ui-btn-up-j" when ACTIVE checkbox is checked

class ui-btn-active is placed before ui-btn-up-j and overwrites background color..

Jon
Posts: 0
Joined: Wed Dec 26, 2012 3:37 am

setting navicons as active on page load

The code you posted at the top of this thread worked for me on a project I had in the old builder. Thanks.

Has the new JQM NavBar been implemented in the new HTML5 builder?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

setting navicons as active on page load

Hello, no we didn't add new components to HTML5 builder.
You can use the supra code.

Reiner Saddey
Posts: 0
Joined: Sun Feb 17, 2013 7:19 am

setting navicons as active on page load

I'm not quite sure where to put Max' work-around code :-(

As I'm using both multi-page layout (all pages within single DOM) and Persistent (in order to restrict animations to the center part), I tried adding the code to the Page Show Event.

Still no luck - multiple Navbar Items will show as active when switching screens :-(

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

setting navicons as active on page load

Hello! You would need to add the code on Page Show event, also check on each screen active item https://getsatisfaction.com/tiggzi/to...

Return to “Issues”