Answer the question
In order to leave comments, you need to log in
How to make smooth anchor scroll for safari ios?
The css has the property scroll-behavior: smoth; , which does not work in some browsers, including safari on ios.
I found the only option on the net - the smoothscroll.js polyfill. The option is either difficult, or I do not have enough experience / skill to put it.
Are there alternatives? Or maybe an instruction in Russian for installing a polyfill? I would be glad for any help :)
Answer the question
In order to leave comments, you need to log in
smoothscroll.js, translating the documentation
Add before the closing body
<script src="path/to/smooth-scroll.polyfills.min.js"></script>
or <script src="https://cdn.jsdelivr.net/gh/cferdinandi/smooth-scroll/dist/smooth-scroll.polyfills.min.js"></script>
<a data-scroll href="#bazinga">Anchor Link</a>
...
<div id="bazinga">Bazinga!</div>
<script>
var scroll = new SmoothScroll('a[href*="#"]');
</script>
var scroll = new SmoothScroll('a[href*="#"]', {
speed: 300
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question