jQuery Scroll在IE 7和IE 8中不起作用 [英] jQuery Scroll doesn't work in IE 7 and IE 8

查看:94
本文介绍了jQuery Scroll在IE 7和IE 8中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我使用的示例:

jQuery(document).ready(function() {

    console.log('scroll');

    jQuery(window).scroll(function () {
        console.log('scrolling 1');
    });

    jQuery(document).scroll(function () {
        console.log('scrolling 2');
    });
});

这只会返回在IE 7和IE 8中滚动".
在Chrome,Firefox和IE 9中,它会一次返回所有内容,并且每当我滚动时都会返回"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.

我也被锁定到jQuery 1.3

I am also locked to jQuery 1.3

有人知道如何在IE 7和IE 8中实现此功能吗?

Does anyone have any idea how to get this working in IE 7 and IE 8?


现在,我发现这似乎与 jQuery Lightbox插件有关.

推荐答案

问题出在 jquery.lightbox.js中的第817行上

$(window).unbind().resize(function ()

这将取消绑定连接到$(window)的所有内容,而不仅仅是调整大小.
因此解决方案是:

This will unbind everything connected to $(window) and not only resize.
So the solution is:

$(window).unbind('resize').resize(function ()

这篇关于jQuery Scroll在IE 7和IE 8中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆