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.