Anton Söffing
Posts: 0
Joined: Fri Mar 22, 2013 4:04 pm

Disable Back Button for a Page

I have a Problem with my Splashscreen....
It navigates avert 4.2 seconds to the Home Page. But wehn I press back it will be go back to the Splashscreen and loads endless. How can i disable the Back Button (Hardware) only for the Home site?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Disable Back Button for a Page

Hi Anton,

You cannot disable Back button on device, but it's possible to add any action on "Backbutton" event.

Emmz
Posts: 0
Joined: Sat Jun 23, 2012 11:06 pm

Disable Back Button for a Page

Anton.
I drop my splash screen then app cant go back.
Example
code
setTimeout(function() {Tiggzi('Splash').detach();Tiggzi.navigateTo('Menu',{ transition: "none"});},4000);
/code
Assuming you splash screen is named "splash" and the screen togoto is "Menu"
Change to suit.

AND/OR

Add this code on Device Ready
code
document.addEventListener("backbutton", mybackHandler, false);

/code
Now in custom JS add this
code
function mybackHandler() {
if ($.mobile.activePage.attr('dsid') == 'Menu'){
alert('Dont Use The BACK Button ! Click Exit Button To Exit...');
}else{
//navigator.app.backHistory();
history.back();
return;
}
}
/code

Return to “Issues”