Reputation: 33
Is there a way to disable the jQuery mobile feature that automatically hides the address bar? If not, is there a workaround I could implement. My problem is that my web app users scroll so I can have a fixed position footer menu bar. When the address bar gets hidden, all of the content shifts up, leaving a space at the bottom. I could probably force it to move back down but there is no way for the user to scroll back up to access the address bar because my app has scrolling disabled.
Is there a way to turn it off or cause everything to scroll back up so that the address bar is visible again?
Upvotes: 2
Views: 3132
Reputation: 4399
This line of code is what is responsible. (Haven't looked at JQM in a while). Get rid of the window.scrollTo( 0, ypos );
and it should work for you. This code is from jquery.mobile-1.0.js
// Scroll page vertically: scroll to 0 to hide iOS address bar, or pass a Y value
silentScroll: function( ypos ) {
if ( $.type( ypos ) !== "number" ) {
ypos = $.mobile.defaultHomeScroll;
}
// prevent scrollstart and scrollstop events
$.event.special.scrollstart.enabled = false;
setTimeout(function() {
window.scrollTo( 0, ypos );
$( document ).trigger( "silentscroll", { x: 0, y: ypos });
}, 20 );
setTimeout(function() {
$.event.special.scrollstart.enabled = true;
}, 150 );
},
Upvotes: 0