I am using jQuery Mobile 1.1.1 and Apache Cordova 2.0.0. I want my app to exit when I press back button but only if current page have ID = feedZive. I am using following code to
We're doing this:
$(document).on("pagecontainershow", function() {
var activePage = $.mobile.pageContainer.pagecontainer("getActivePage");
var activePageId = activePage[0].id;
if(activePageId != 'splashPage') { //fix rotation splash flash bug
$("#splashPage").hide();
} else {
$("#splashPage").show();
}
switch(activePageId) {
case 'loginPage':
loginPageShow();
break;
case 'notificationPage':
notificationPageShow();
break;
case 'postPage':
postPageShow();
break;
case 'profilePage':
profilePageShow();
break;
case 'splashPage':
splashPageShow();
break;
case 'timelinePage':
timelinePageShow();
break;
default:
break;
}
});
And navigation works like this:
$.mobile.loading('hide');
$(":mobile-pagecontainer").pagecontainer("change", "#timelinePage", {
transition: 'none'
});