ScrollIntoView inside iFrame not working on iPhone Browser

This code is intended to go to the "timeline" element when you click on something from the "modalButton" class.

The code is inside an iFrame.

It works fine on Chrome on my desktop, but it doesn't work inside the iPhone (both Chrome and Safari). Is there any fix for this or alternative methods to make this work?

<script>
            $( document ).ready(function() {
            $( ".modalButton" ).click(function() {
                    document.getElementById("timeline").scrollIntoView();
            });
        });

    </script>
+4
source share

Source: https://habr.com/ru/post/1672646/


All Articles