jQuery Mobile pagebeforehide Event
Example
Text pops up after a page transition and before the old page is hidden:
$(document).on("pagebeforehide","#pagetwo",function(){
alert("pagebeforehide event triggered - page two is about to be hidden");
});
Try it »
Definition and Usage
pagebeforehide is an event triggered after a page transition and before the old page is hidden.
Related events:
- pagehide - The event triggered after 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 at the start/end of a page transition.
Syntax
Trigger all page events in jQuery Mobile:
$("document").on("pagebeforehide",function(event){...})
Try it
Trigger a specified page event:
$("document").on("pagebeforehide","
page
",function(event){...})
Try it
| Parameters | Description |
|---|---|
| function(event,data) | Required. Specifies the function to execute when the pagebeforehide 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