Page 2 of 2

setting navicons as active on page load

Posted: Wed Sep 05, 2012 3:13 pm
by Maryna Brodina

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


setting navicons as active on page load

Posted: Fri Oct 12, 2012 12:54 pm
by Kevin

Thanks for this Max. Worked out well for me.


setting navicons as active on page load

Posted: Sat Nov 17, 2012 2:30 pm
by Eric5020946

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


setting navicons as active on page load

Posted: Fri Dec 28, 2012 4:33 pm
by Jon

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?


setting navicons as active on page load

Posted: Sat Dec 29, 2012 8:14 am
by Kateryna Grynko

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


setting navicons as active on page load

Posted: Mon Mar 11, 2013 3:45 pm
by Reiner Saddey

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 :-(


setting navicons as active on page load

Posted: Tue Mar 12, 2013 6:35 am
by Maryna Brodina

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