Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
139
rated 0 times [  140] [ 1]  / answers: 1 / hits: 22071  / 13 Years ago, mon, september 26, 2011, 12:00:00

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.


More From » jquery

 Answers
12

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


[#89931] Friday, September 23, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
terrencegreysons

Total Points: 674
Total Questions: 102
Total Answers: 105

Location: New Caledonia
Member since Thu, Mar 23, 2023
1 Year ago
;