1

我正在使用以下代码为我的 jscrollpane 分配新箭头。这在所有浏览器中都可以正常工作,但在 ie7/8 中存在问题。可以在http://jsfiddle.net/WzNM4/6/上找到该错误的示例。

如果单击向下按钮,让它运行 2 秒,然后单击向上按钮,文本开始上下跳跃。您知道是什么原因造成的以及如何解决吗?

我知道我附加的代码与 jsFiddle 中的不一样,但是 jsFiddle 是由 Vitch 完成的,我觉得没有必要重做它,因为该错误也发生在他的版本上。

这只发生在 ie7/8 中...

先感谢您。

    $(function () {

        var api = $('.ThmbsCntnr').jScrollPane().data('jsp');


        $('.FinalArrowLeft').bind('mousedown', function () {
                var interval = setInterval(
                    function () {
                        api.scrollByX(-40);
                    },
                    100
                );
                $(window).bind(
                    'mouseup.jspExample',
                    function () {
                        clearInterval(interval);
                        $(document).unbind('.jspExample');
                    }
                );
       });

       $('.FinalArrowRight').bind('mousedown', function () {
                var interval = setInterval(
                    function () {
                        api.scrollByX(40);
                    },
                    100
                );
                $(window).bind(
                    'mouseup.jspExample',
                    function () {
                        clearInterval(interval);
                        $(document).unbind('.jspExample');
                    }
                );
       });




    });
4

1 回答 1

0

发生的事情是该mouseup事件永远不会被触发。

在 IE7 和 IE8 中绑定mouseup事件不起作用。window而是将其绑定document

演示:http: //jsfiddle.net/Guffa/WzNM4/44/

于 2011-12-13T07:22:32.970 回答