Search code examples
javascriptiphoneiosmobilemobile-website

Hide URL bar without hiding Smart App Banner on iOS


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.


Solution

  • 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!