Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

181
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda