0
我想使窗口scrollTop的div。jquery动画:在IE中跟随窗口滚动的问题
在FF中看起来不错,但在IE(6,7)中,动画跳转并导致窗口滚动跳转。
我试过放松,但没有奏效。
我的代码:
<div style="float:left;width:500px;height:4000px; background-color:Blue;">
<br/>
</div>
<div id="Div1" style="position:relative; float:left; height:4000px; width:300px;">
<div id="sidePanel" style="position:absolute; top:0px; left:0px;width:200px; height:200px; border:solid 1px black;">
SIDE PANEL<br/><br/>
<div id="info"></div>
<br />
<button id="showCurrTop" onclick="alert($(window).scrollTop());">$(window).scrollTop()</button>
</div>
</div>
$(document).ready(function(){
$(window).scroll(function() {
var scrollTop = $(window).scrollTop();
$("#sidePanel").stop(false,false);
$("#sidePanel").animate({"top": scrollTop + 200}, 1000);
$("#info").html(scrollTop);
});
});
如果我理解你的权利,你希望在页面滚动移动一个div。如果是这样,为什么不简单地使用CSS'position:fixed'? – 2010-03-08 10:22:39
我想让它像http://kitchen.net-perspective.com/sf-example-1.html(它也在IE上跳转)制作动画 – SirMoreno 2010-03-08 10:26:04