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

257
Vistas
Why does ScrollTo() not accept a top value of Number.POSITIVE_INFINITY?

I noticed the following:

  • In Chrome, using scrollTo on an element with top set to Number.POSITIVE_INFINITY or Number.MAX_VALUE cause the element to scroll to the top. It is only possible to make the element scroll to the bottom by using a number such as Number.MAX_SAFE_INTEGER. I also tried Number.MAX_SAFE_INTEGER + 1000 and it also worked.
  • In Safari, Number.MAX_SAFE_INTEGER and Number.MAX_VALUE both worked to scroll to the bottom, but Number.POSITIVE_INFINITY also scrolled to the top.
  • In Firefox, the behavior is the same as Safari.

This has been tested on macOS.

Anyway, I'm curious why POSITIVE_INFINITY won't work, and why MAX_VALUE also won't work for Chrome I suppose some source code spelunking would easily reveal the answer. I wonder if the spec has anything to say about it, but the inconsistency in implementations would indicate that maybe it's not rigorously defined.

about 4 years ago · Santiago Trujillo
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