YouTip LogoYouTip

Event Pagebeforehide

# jQuery Mobile pagebeforehide Event [![Image 4: jQuery Mobile Events](#) jQuery Mobile Events](#) ## Example Alert a text message before the old page is hidden after a page transition: $(document).on("pagebeforehide","#pagetwo",function(){ alert("pagebeforehide event triggered - page two is about to be hidden"); }); [Try it Yourself Β»](#) * * * ## Definition and Usage The `pagebeforehide` event is triggered after a page transition has started, but before the old page is hidden. **Related Events:** - Triggered after the old page has been hidden following a page transition. - Triggered before the new page is displayed after a page transition. - Triggered after the new page is displayed following a page transition. **Note:** This event is triggered at the start/end of the page transition. * * * ## Syntax Trigger all page events in jQuery Mobile: $("document").on("pagebeforehide",function(event){...}) (#) Trigger a specific page event: $("document").on("pagebeforehide","_page_",function(event){...}) (#) | Parameter | Description | | --- | --- | | function(event,data) | Required. Specifies the function to run when the `pagebeforehide` event is triggered. This function has the following two parameters: * **event object** - Includes any jQuery event properties (event.target, event.type, etc.). For more information, see the (#). * **data object** - Contains the property `nextPage`, the transition page to return to. | | _page_ | Optional. Specifies the page ID that the `pagebeforehide` event points to when triggered. For internal pages, use _#id_. For external pages, use _externalfile.html_. | * * * ![Image 5: Examples](#) ## More Examples [Demonstration of related events.](#) This example demonstrates the triggering of the `pagebeforeshow`, `pageshow`, `pagebeforehide`, and `pagehide` events. (#) Using the `event.timeStamp` property. (#) Using the `nextPage` property to return the transition page. * * jQuery Mobile Events](#)
← Event PagebeforeloadEvent Pagebeforecreate β†’