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

172
Views
Diferencia en la animación de desplazamiento hacia arriba y hacia abajo a pesar de que el código es el mismo + necesidad de detener nuevas entradas durante la animación

Tengo esta animación de desplazamiento que mueve un div hacia arriba y hacia abajo simulando un desplazamiento, ¿por qué hay una diferencia en el comportamiento del movimiento hacia arriba y hacia abajo?

 let position = ''; let scrolling = false; let animationDuration = 800; let position = ''; let scrolling = false; let animationDuration = 800; $(window).bind('mousewheel', function(event) { if (event.originalEvent.wheelDelta > 0) { // scroll up if (scrolling || position === 'top') return; scrolling = true; position = 'top'; $('#bottom').stop().animate({ top: "100vh" }, animationDuration, 'linear', function() { scrolling = false; }, ); } else { if (scrolling || position === 'bottom') return; scrolling = true; position = 'bottom'; $('#bottom').stop().animate({ top: "0" }, animationDuration, 'linear', function() { scrolling = false; }, ) } })

https://jsfiddle.net/o4vg6f8y/1/

cuando mueve el #bottom hacia arriba, parece que comienza desde donde finaliza su entrada de desplazamiento, este comportamiento no es deseado.

Quiero el mismo movimiento que cuando giras la rueda de abajo hacia arriba

Además, necesito dejar de superponer entradas mientras la animación está activa, este problema provoca fallas.

Gracias por la ayuda.

EDITAR: WTF, creo que lo resolví con un cuerpo {overflow: hidden;} Tal vez la posibilidad de desplazarse estaba estropeando la animación general.

Por cierto, me gustaría escuchar si hay algo más que saber al respecto. Gracias.

about 4 years ago · Juan Pablo Isaza
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!