I have a jquery mobile page that uses the following code to hide a button when the page is accessed.
$('div:jqmData(role="page")').live('pagebeforeshow',function(){
$("#apply_btn").hide()
});
My problem is that the event only fires when the page is refreshed and not when arriving at the page from somewhere else in the site.
I have tried using the "pageshow" event and the "pageinit" event but it still only fires when the page is refreshed.
Just to remember that live method has been removed from jQuery 1.9. You should use from now on the on method:
$( '#yourPage' ).on( 'pagebeforeshow',function(event){
$("#uniqueButtonId").hide();
});
Have a look at http://jquerymobile.com/demos/1.1.0/docs/api/events.html
This is the syntax:
$( '#yourPage' ).live( 'pagebeforeshow',function(event){
$("#uniqueButtonId").hide();
});
Good Luck
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With