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

67
Views
scroll navbar out of view when page is ready using jquery
<div id="navbar"> ... </div>
<div id="mainpage" style="height: 100vh;"> ... </div>
<div id="footer"> ... </div>

when the page is ready, i want the jquery to scroll out the complete navbar div, for this, i am currently using -

$(document).ready(function(){
    var navHeight = $('#navbar').height();
    console.log(navHeight);
    $('body,html').animate({scrollTop: navHeight}, 400); 
})

this only lefts some portion of navbar in view, there is enough area left in footer to scroll.

i dont now why is this happening

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

0

Use this it may help you.

$(document).ready(function(){
    var navHeight = $('#navbar').css("height","100%");
    console.log(navHeight);
    $('body,html').animate({scrollTop: navHeight}, 400); 
})
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!