iFrame 内的 ScrollIntoView 在 iPhone 浏览器上不起作用

kev*_*nkt 5 javascript iphone jquery ios

此代码旨在当您单击“modalButton”类的任何内容时滚动到元素“时间轴”。

该代码位于 iFrame 内。

它在我的桌面上的 Chrome 上完美运行,但在 iPhone(Chrome 和 Safari)中无法运行。有没有对此进行修复或替代方法来使其工作?

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

    </script>
Run Code Online (Sandbox Code Playgroud)