Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

499
Views
how hide address bar in mobile using javascript or css

we want to know how we can to hide address bar of mobile browser. we see few topics about of this problem and we test them and don't working. please check your code is hide address bar and help me to know how we should to do

we want to hide mobile browser address bar (URL bar) with using javascript or css.

enter image description here

thanks everyone for help

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

What code have you tried previously?

This is a pretty standard way of hiding the address bar in mobile.

// New event listener:
window.addEventListener("load",function() {
    setTimeout(function(){
        // Hide the address bar:
        window.scrollTo(0, 1);
    }, 0);
});

JSFiddle to demonstrate: https://jsfiddle.net/bjcra2vx/

about 4 years ago · Juan Pablo Isaza Report

0

Extended solution from above. This should cover all bases for you. Next time please share your own attempts first:

// Extended solution for hiding address bar:

(function() {
    
  var browser = window,
      doc = browser.document;

  // If there's a hash, or addEventListener is undefined, stop here
  if ( !location.hash || !browser.addEventListener ) {

    //set to 1
    window.scrollTo( 0, 1 );
    var scrollTop = 1,

    //reset to 0 if needed
    checkWindowBody = setInterval(function(){
      if( doc.body ){
        clearInterval( checkWindowBody );
        scrollTop = "scrollTop" in doc.body ? doc.body.scrollTop : 1;
        browser.scrollTo( 0, scrollTop === 1 ? 0 : 1 );
      } 
    }, 15 );

    if (browser.addEventListener) {
      browser.addEventListener("load", function(){
        setTimeout(function(){
          //reset to hide address
          browser.scrollTo( 0, scrollTop === 1 ? 0 : 1 );
        }, 0);
      }, false );
    }
  }

})();
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!