Reputation: 683
Is it possible to hide the address URL bar but not the Smart App Banner on iOS Safari?
I have tried the solutions from this question: Hiding address bar without hiding the smart app banner on iOS 6, but it doesn't seem to work. The Smart Banner still gets hidden when I use MBP.hideUrlBarOnLoad
from https://github.com/h5bp/mobile-boilerplate/blob/master/js/helper.js, as the answer suggests to do.
Upvotes: 5
Views: 1820
Reputation: 566
The only reason this works is because it throws a javascript error on
mob.SetUpEvents();
Which makes it disable the scroll jump. It will however mess up additional javascript.
You can change it to anything which throws a javascript error and the banner will not hide.
This solution is not an effective one.
Thank You
The website volotea.com that you have linked to does not work, when the page loads it jumps and hides the smart app banner and the url bar both. We have to scroll up to see the smart-app-banner.
Upvotes: 0
Reputation: 302
I use:
$(document).ready(function () {
mob.SetUpEvents();
setTimeout(function () {
if (jQuery("html.iphone").length > 0) {
jQuery('html').css( "height", ( jQuery(window).height() + 60) + 'px');
window.ScrollTo(0, 1);
}
}, 400);
});
I hope this helps!
Upvotes: 2