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

143
Views
How to make a smooth scroll animation onclick on IOS devices?

I am building a footer and of the options of the footer is "home" and when it's clicked it should scroll smoothly up and that works on my pc, but what I noticed is that it doesn't work on IOS devices. I read that the css line: HTML{ scroll-behavior: smooth;} does not work on IOS devices
<!--html code<a class="link-1" onclick="test()" href="#">Home</a>
I read a lot of the forms here on Stack Overflow. I tried a lot of thing such as:

  window.scrollTo({ top: 900, behavior: 'smooth' })
}

or using css

    overflow:scroll
-webkit-overflow-scrolling: touch;

or

document.querySelectorAll('a[href^="#"]').forEach(anchor => {
    anchor.addEventListener('click', function (e) {
        e.preventDefault();

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

But nothing worked. It just jumps to the top. I'm slowly running out of ideas.
Any ideas? Thanks!

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!