jQuery Mobile pagehide event
Example
Pop up some text after the old page is hidden following a page transition:
$(document).on("pagehide","#pagetwo",function(){
alert("pagehide event triggered - page two hidden");
});
Try it »
Definition and Usage
pagehide is an event triggered after the old page is hidden following a page transition.
Related events:
- pagebeforehide - The event triggered before the old page is hidden following a page transition.
- pagebeforeshow - The event triggered before display following a page transition.
- pageshow - The event triggered after display following a page transition.
Note: This event is triggered each time a page transition starts/stops.
Syntax
Trigger the event for all pages in jQuery Mobile:
$("document").on("pagehide",function(event){...})
Try it
Trigger the event for a specified page:
$("document").on("pagehide","
page
",function(event,data){...})
Try it
| Parameters | Description |
|---|---|
| function(event,data) | Required. Specifies the function to execute when the pagehide event is triggered.
This function contains the following two parameters: |
More examples
Related events demonstration
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.
jQuery Mobile Events