滚动页面时滚动Div [英] Scroll a Div when Scroll the page
问题描述
$(window).scroll(function(){
$ .each($('。Search'),function(){
var windowpos = $(window).scrollTop();
var finaldestination = windowpos + 90;
$(this).stop()。animate({'top':finaldestination},300);
});
});
这个函数jQuery在Internet Explorer 9中不起作用。
我试图做一个包含属性位置的CSS:已修复,但在Internet Explorer 9中不起作用。
当用户在Internet Explorer中滚动页面时,有一种解决方案可以让我滚动div。
我为基础英语道歉
在IE中可以正常工作。我用于搜索的CSS是
.search {
position:absolute;
top:90px;
}
编辑
<
$ b
.stop(true)
$ c $>对于更快的动画转换,清除队列。 c>
This function jquery, scroll a div (with the css named "Search") when the user scroll the page..
$(window).scroll(function(){
$.each($('.Search'),function(){
var windowpos = $(window).scrollTop();
var finaldestination = windowpos+90;
$(this).stop().animate({'top':finaldestination},300);
});
});
This function jquery doesn't work in Internet Explorer 9. I tried to do a css that contain the attribute position:fixed but this doesn't work in Internet Explorer 9. There is a solution that allows me to scroll a div when the user scrolls the page in Internet Explorer? I apologize for the basic English
Works fine in IE. The CSS I used for search is
.search {
position: absolute;
top: 90px;
}
Edit
For a faster animation transition, clear the queue.
.stop(true)
这篇关于滚动页面时滚动Div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!