Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

116
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda