Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resetting Button States in JQuery

I am creating a Phonegap & JQuery mobile application. I have some buttons, and on navigating in the app, if you go back to the menu screen you see them still selected (in active state) or else in hover state.

Is it possible to reset the state once the user goes back to the menu screen?

like image 981
user1809790 Avatar asked Mar 11 '26 18:03

user1809790


1 Answers

Yes you can, you need to remove its ui-btn-active class.

Example:

$("#button").removeClass("ui-btn-active");

Do it in pagebeforeshow event:

$('#page').live('pagebeforeshow',function(e,data){    
    $("#button").removeClass("ui-btn-active");
});
like image 98
Gajotres Avatar answered Mar 14 '26 07:03

Gajotres



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!