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

查看:147
本文介绍了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中滚动。
And在Chrome,Firefox和IE 9中,只要我滚动,它就会返回所有内容并滚动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

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

这将解除连接到$(窗口)的所有内容,而不仅仅是调整大小。$
所以解决方案是:

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天全站免登陆