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

140
Views
How to scroll down and display section on the same page?

I'm developing a one-page website, when user clicks a particular button it should be scrolled down to another section on the page.

Can anyone guide me how to do that?

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

0

I think the CSS property scroll-padding-top is your answer.

about 4 years ago · Juan Pablo Isaza Report

0

You have different options to solve this

The first approach is to use only HTML to scroll to the element with an specific id

html{height:3000px;scroll-behavior: smooth;}
#readmore{position:absolute; top:2000px;}
<a href="#readmore">Scroll down</a>
<h1 id="readmore">
Read More
</h1>

The second approach is to use scrollIntoView method, which scrolls the specified element into the visible area of the browser window.

const element = document.getElementById("readmore");

document.getElementById('btn').addEventListener('click', () => {
  element.scrollIntoView();
})
html{height:3000px;scroll-behavior: smooth;}
#readmore{position:absolute; top:2000px;}
<button id="btn">Scroll down</button>
<h1 id="readmore">
Read More
</h1>

The third approach is to hard code the specific location where I would like to scroll, in this case I set it to 2000px (height)

const element = document.getElementById("readmore");

document.getElementById('btn').addEventListener('click', () => {
    window.scrollTo(0, 2000);
})
html{height:3000px;scroll-behavior: smooth;}
#readmore{position:absolute; top:2000px;}
<button id="btn">Scroll down</button>
<h1 id="readmore">
Read More
</h1>

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!