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

129
Views
Desplazamiento suave con solo JavaScript vainilla

Siempre he usado este script jQuery para un desplazamiento suave:

 var root = $('html, body'); $('a[href^="#"]').click(function() { root.animate({ scrollTop: $($.attr(this, 'href')).offset().top }, 1000); return false; });

¿Cómo puedo hacer esto con vainilla JavaScript? He intentado esto:

 document.querySelector(this.getAttribute('href')).scrollIntoView({ behavior: 'smooth' });

Pero no funciona con Safari, lo cual es un factor decisivo para mí.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Como puede leer en los documentos , safari no admite parámetros de opciones en scrollIntoView , por lo que deberá encontrar otro método. Sugiero echar un vistazo a esta alternativa .

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