jQuery Mobile pagebeforeshow
Event
Example
Display a text message before the page is shown after a transition:
Definition and Usage
The pagebeforeshow
event is triggered before the page is shown after a transition.
Related Events:
- pageshow - Triggered after the page is shown after a transition.
- pagebeforehide - Triggered before the old page is hidden after a transition.
- pagehide - Triggered after the old page is hidden after a transition.
Note: This event is triggered at the start/stop of each transition page.
Syntax
To trigger the event for all pages in jQuery Mobile:
To trigger the event for a specified page:
Parameter | Description |
---|---|
function(event, data) | Required. Specifies the function to run when the pagebeforeshow event is triggered. The function includes the following two parameters: Event object - Includes any jQuery event properties (event.target, event.type, etc.). For more information, refer to the jQuery Event Reference. Data object - Contains properties such as prevPage , which returns the previous page of the transition. |
page | Optional. The page ID that the pagebeforeshow event points to. For internal pages, use #id. For external pages, use externalfile.html. |