Mobile Front End: Hide the address toolbar on your phone

Source: Internet
Author: User

When moving the front-end interface, we'll see the Address toolbar, which doesn't look like an app, so how to hide the address bar, here is a more appropriate code, support for iOS and Android.

 /*! Normalized address bar hiding for IOS & Android (c) @scottjehl MIT License */(function (Win) {var doc = win.document;/ /If There ' s a hash, or addeventlistener is undefined, stop hereif (!win.navigator.standalone &&!location.hash &am p;& Win.addeventlistener) {//scroll to 1win.scrollto (0, 1); var scrolltop = 1,getscrolltop = function () {return WIN.PA Geyoffset | | Doc.compatmode = = = "Css1compat" && Doc.documentElement.scrollTop | | Doc.body.scrollTop | | 0;},//reset to 0 on bodyready, if Neededbodycheck = SetInterval (function () {if (doc.body) {clearinterval (bodycheck); Scrol Ltop = Getscrolltop () win.scrollto (0, ScrollTop = = 1? 0:1);}}, Win.addeventlistener ("Load", function () {settime Out (function () {//at load, if user hasn ' t scrolled more than/So...if (Getscrolltop () <) {//reset to hide addr b AR at Onloadwin.scrollto (0, scrolltop = = = 1? 0:1),}}, 0);}, False);}) (this);  

For more information, please visit: Https://github.com/scottjehl/Hide-Address-Bar

If your browser supports tag hiding:

Name="apple-mobile-web-app-capablecontent=" Yes/>     

Mobile Front End: Hide the address toolbar on your phone

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.