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

119
Visualizações
Div horizontally scrolling without touch

From this I got my div to scroll horizontally.

overflow-x:scroll;
white-space: nowrap;

However, in mobile devices, this div also scrolls when the content is touched, I only want it to scroll when the scrollbar is touched.

The reason is that the div content has a slider which must be scrolled as well and the user has to be precise in order to touch the slider.

I only want the div to be scrolled when the scrollbar is touched. Is that possible?

Best

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Try below, I have added a position: fixed div inside scrolling div and reduced the scrollbar width from total width.

.scroll{
  overflow-x:scroll;
  white-space: nowrap;
  height: 200px;
  position: relative;
}
.scroll .overlay{
  position: fixed;
  top: 0;
  left:0;
  width: calc(100% - 30px);
  height: 200px;

}
<div class="scroll">
<p>a</p>
<p>a</p>
<p>a</p>
<p>a</p>
<p>a</p>
<p>a</p>
<p>a</p>
<p>a</p>
<p>a</p>
<p>a</p>
<p>a</p>
<p>a</p><p>a</p>
<div class="overlay"></div>
</div>

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