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

188
Views
I want to implement select and scroll the window without touching scroll bar using javascript

Suppose an user wants to select all the content from a webpage, he/she selects and start dragging the pointer to the bottom edge of the window. Now who can we make the webpage scroll down.

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

0

If someone starts scrolling the page by selecting some text then it's the responsibility of the window to scroll down. If you want to make some scrolling events then you might have to use window.scrollTo method.

function scrollWin() {
  window.scrollTo(200, 0);
}
<!DOCTYPE html>
<html>
<style>
body {
  width: 5000px;
}
</style>

<body>
<h1>The Window Object</h1>
<h2>The scrollTo() Method</h2>

<p>Click to scroll the document.</p>

<button onclick="scrollWin()" style="position:fixed">Scroll to 200 horizontally!</button><br><br>


</body>
</html>

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!