我正在使用Twitter Bootstrap来设计一个iPad优化的网站,并在iOS5的Mobile Safari中遇到一个有趣的错误.
点击固定位置导航栏中的锚链接后,它正确地将我带到该锚点.但是,在滚动页面之前,我无法单击导航栏中的任何其他链接.
问题似乎出现在Bootstrap本身,因为Bootstrap站点有同样的问题:http://twitter.github.com/bootstrap/
有关如何解决这个问题的任何建议?
下面的代码重现了这个问题.请注意,如果单击"Test JS"或"Test jQuery"(两种不同类型的滚动,直接JS或基于jQuery),则在手动移动页面之前,您将无法再次单击.
这是基本的演示代码(.jsp):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style type="text/css">
#testDiv {
position: fixed;
bottom: 0;
right: 0;
background: gray;
padding: 20px;
}
#jsDiv,
#jQueryDiv {
width: 200px;
display: block;
height: 40px;
background-color: red;
}
#jQueryDiv {
background-color: yellow;
}
</style>
<script type="text/javascript">
function testScroll() {
alert("JS");
scroll(0, 5000);
}
function testjqScroll() {
alert("JQuery");
$(window).scrollTop(500);
}
</script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.js"></script>
</head>
<body>
<%for (int i …Run Code Online (Sandbox Code Playgroud)