admin管理员组文章数量:1431764
Here is an example of what I use:
jQuery(document).ready(function() {
console.log('scroll');
jQuery(window).scroll(function () {
console.log('scrolling 1');
});
jQuery(document).scroll(function () {
console.log('scrolling 2');
});
});
This will only return "scroll in IE 7 and IE 8.
And in Chrome, Firefox and IE 9 it will return everything one time and "scrolling 2" whenever I'm scrolling.
I am also locked to jQuery 1.3
Does anyone have any idea how to get this working in IE 7 and IE 8?
Edit:
I have now found out that the reason of this seems to relate to a jQuery Lightbox Plugin.
Here is an example of what I use:
jQuery(document).ready(function() {
console.log('scroll');
jQuery(window).scroll(function () {
console.log('scrolling 1');
});
jQuery(document).scroll(function () {
console.log('scrolling 2');
});
});
This will only return "scroll in IE 7 and IE 8.
And in Chrome, Firefox and IE 9 it will return everything one time and "scrolling 2" whenever I'm scrolling.
I am also locked to jQuery 1.3
Does anyone have any idea how to get this working in IE 7 and IE 8?
Edit:
I have now found out that the reason of this seems to relate to a jQuery Lightbox Plugin.
- As I recall you can give the body relative positioning or something like that to make it work. Sorry I don't have time to sort it for you! – mrtsherman Commented Jan 4, 2012 at 16:02
- It seems like the problem is not the code it self but some other script that is interfering. – Patrik Commented Jan 4, 2012 at 18:18
2 Answers
Reset to default 2The issue was on row 817 in jquery.lightbox.js
$(window).unbind().resize(function ()
This will unbind everything connected to $(window) and not only resize.
So the solution is:
$(window).unbind('resize').resize(function ()
Check out the ScrollTo plug-in.
http://flesler.blogspot./2007/10/jqueryscrollto.html
Their demo page uses jQuery 1.3.2 -
http://demos.flesler./jquery/scrollTo/
Also note:
Doesn't scroll on IE. Sometimes, you need to set a position (relative or absolute) to the container and give it fixed dimensions, in order to hide the overflow. If this doesn't work, try giving the container fixed dimensions (height & width).
UPDATED Using jQuery 1.11.1, using jquery.scrollTo release 1.4.13 with the following:
$( '#parent' ).scrollTo( $( '#target' ), 800 );
This works on IE 7.0.5730.11.
本文标签: javascriptjQuery Scroll doesn39t work in IE 7 and IE 8Stack Overflow
版权声明:本文标题:javascript - jQuery Scroll doesn't work in IE 7 and IE 8 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745473993a2659877.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论