Chrome / Opera使用旧的scrollTop直到下一个滚动

时间:2018-11-14 12:56:41

标签: google-chrome scroll opera scrolltop

为什么Chrome / Opera使用旧的直到下一个滚动,而其他浏览器(IE11,IE Edge和Firefox)却不使用?

要在Chrome / Opera中重现此问题,请执行以下操作:将鼠标悬停在绿色按钮上并向下滚动,然后移出div。 div将开始闪烁。

JSFiddle:https://jsfiddle.net/dq5w0k8a/

<html>
<body>
    <div>
        <div id="full-height-page" style="width: 400px; height: 500px; overflow: auto; margin: 0px -15px; padding: 15px; position: relative;">
            <div style="height:700px;background:blue;width:400px;">

            </div>

            <div style="background:green;width:25px;height:25px" onmouseover="show()" onmouseout="hide()">
            </div>


            <div class="components-wrapper" style="width: 400px; height: 600x;">
                <div id="popover" style="left: 555px; top: 575px; width: 360px; overflow-wrap: break-word;display:none">
                    "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
                    </div>
            </div>
        </div>
        <script>
            function show() {
                document.getElementById("popover").style.display = "block";
          };

                function hide() {
                document.getElementById("popover").style.display = "none";
          };
            </script>

    </body>
</html>

0 个答案:

没有答案