jQuery Mobile pagehideEvent
Examples
Pop up some text information after the old page is hidden after a page transition:
$(document).on("pagehide","#pagetwo",function(){
alert("pagehide event fired - page 2 hidden");
});
alert("pagehide event fired - page 2 hidden");
});
Try it Yourself »
Definition and Usage
The pagehide event is triggered after the old page is hidden after a page transition.
Related events:
- pagebeforehide- The event triggered before the old page is hidden after a page transition.
- pagebeforeshow- The event triggered before display after a page transition.
- pageshow- The event triggered after display after a page transition.
Note:This event is triggered every time a page transition starts/stops.
Syntax
Trigger the event for all pages in jQuery Mobile:
$("document").on("pagehide",function(event){...})
Try it Yourself
Trigger the event for a specified page:
$("document").on("pagehide","page",function(event,data){...})
Try it Yourself
| Parameters | Description |
|---|---|
| function(event,data) | Required. Specifies the function to execute when the pagehide event is triggered. This function contains the following two parameters:
|
| page | Optional. Specifies the id of the page pointed to when the pagehide event is triggered. For internal pages, use#id. For external pages, use externalfile.html。 |

More Examples
Related events demo
This example demonstrates the triggering of the pagebeforeshow, pageshow, pagebeforehide, and pagehide events.
Event object
Use the event.timeStamp property.
Data object
Use the nextPage property to return the transition page.
Other extensions
jQuery Mobile Events