动画窗口滚动 [英] Animate window scroll
问题描述
我想动画窗口滚动从当前位置
到垂直方向的另一个位置。我用过这段代码
< pre> $(html,body)。animate({scrollTop:pos-100},500 );< / pre>
但它从0滚动而不是当前窗口位置,我的意思是首先它会滚动到顶部然后滚动
desiered position
我该如何解决这个问题?
i解决了它在下面,但是......
它在IE上不起作用(v10)!!
在chrome上测试它的工作原理
如果跨浏览器如何解决这个跨浏览器问题?
(html,body)。animate({ scrollTop:pos-100},500);< / pre>
但它从0滚动而不是当前窗口位置,我的意思是首先它会转到顶部然后滚动到
desiered position
我该如何解决这个问题?
i在下面解决了它,但是......
它在IE上不起作用(v10)!!
在chrome上测试它有效
如果跨浏览器如何解决这个跨浏览器问题?
我自己解决了这个问题
你应该在动画代码之后输入以下代码
(a).click(function(){
i want to animate window scroll from current position
to another position in vertical direction. i used this code
<pre>$("html,body").animate({scrollTop : pos-100} , 500);</pre>
but it scrolls from 0 not current window position, i mean at first it goes to top then scrolls to
desiered position
how can i solve this?
i solved it below, but...
it doesn't work on IE(v10)!!
tested on chrome and it worked
how to solve this cross-browser issue if it is cross-browser?
("html,body").animate({scrollTop : pos-100} , 500);</pre>
but it scrolls from 0 not current window position, i mean at first it goes to top then scrolls to
desiered position
how can i solve this?
i solved it below, but...
it doesn't work on IE(v10)!!
tested on chrome and it worked
how to solve this cross-browser issue if it is cross-browser?
i solved it myself
you should enter the following code after the animate code
(a).click(function(){
这篇关于动画窗口滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!