0
我在Mac Os上遇到了一些非常奇怪的滚动问题(版本57.0.2987.133(64位))。Chrome浏览器无法在页面刷新上工作
首先我的各种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>
要重现该问题进行如下:
- 打开html - 这应该可以正常工作并向下滚动到正确的位置。
- 向下滚动到窗口底部或其他位置。
- 通过点击'重新加载'按钮来重新加载页面,或者在再次选择之后按下URL地址栏上的输入。
我希望重新加载滚动时会重新定位,但它不会。在safari中的操作似乎正常工作..
我在这里做错了什么?其他人是否会得到这种行为?