Jquerymobile. define a transition between pages

Since all of the pages are in the same tag "body", after leaving the page with the audio, the player continues to play. How can you catch what the user has left the page and stop the audio?

Upvotes: 0

Views: 77

Answers (1)

Vinay Revankar
Vinay Revankar

Reputation: 832

Check if the current page is not the page your playing audio and handle accordingly.You can use below code to know which is your current page.

var activePage = $('.ui-page-active').attr('id');
if (activePage != "your-audio-page-id") {
}

Upvotes: 1

Related Questions