Chrome滚动浏览无法在页面重新加载

时间:2017-04-11 06:57:21

标签: javascript jquery html css google-chrome

我在Mac Os上遇到了一些非常奇怪的Chrome浏览器问题(版本57.0.2987.133(64位))。

首先,我的各种jquery和javascript函数对我来说都不正常,例如scrollTop() scrollBy()window.scrollTo()

为了显示问题,我有以下代码:

<!DOCTYPE HTML>
<html>
<head>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js" type="text/javascript"></script>
<style>
#outter {
   height:5000px;
   background-color:grey;
   position:relative;
}

#inner1 {
   position:absolute;
   top:600px;
   height:100px;
   width:200px;
   background-color:red;
}

#inner2 {
   position:absolute;
   top:1200px;
   height:100px;
   width:200px;
   background-color:red;
}

</style>
<script>
$(document).ready(function() {
   console.log("DD");
   window.scrollTo(0,600);
});
</script>


</head>
<body>

<div id="outter">
   <div id="inner1">
      hello1
   </div>

   <div id="inner2">
      hello2
   </div>

</div>

</body>
</html>

要重现此问题,请执行以下操作:

  1. 打开html - 这应该可以正常工作并向下滚动到正确的位置。
  2. 向下滚动到窗口底部或其他位置。
  3. 点击“重新加载”重新加载页面。按钮或再次选择后在URL栏上按Enter键。
  4. 我原本预料到重新加载卷轴会重新定位,但它不会。野生动物园的行动似乎正常运作..

    我在这里做错了吗?其他人有这种行为吗?

1 个答案:

答案 0 :(得分:1)

我有chrome 57.0.2987.133,我认为这是Chrome 57.0.2987.133中的一个错误,它发生在您更改滚动条事件时,前点击Facebook喜欢计数,然后当您退出时它将不再滚动!

相关问题