1

Personally, I am not experiencing this issue (Windows 7 with native IE9) but another computer is. Possibly Windows 7 but definitely IE9. Initially, the scroll buttons do not work on their machine. If they change their document and browser renderer to IE8 or IE7 if works fine then. If they change it back to IE9, it works. If they close out of the tab and reopen it fresh, it doesn't work again. Their console log is empty except for a syntax error deep within jQuery 1.4 which appears in all browsers and which I THINK is benign.

So my question is, can anyone replicate the issue or can find any reason why this is happening? Code and link to follow:

http://www.friedmanllp.com/home2.php

<div style="float:left; padding:0; width:20px !important; height:310px !important; text-align:left;">
    <div id="scroll_up" style="cursor:pointer;"><img style="margin:10px 0 270px 0;" src="images/arrow_up.png" /></div>
    <div id="scroll_down" style="cursor:pointer;"><img src="images/arrow_down.png" /></div>
</div>

$(function() {
    var ele   = $('#scroller');
    var speed = 25, scroll = 5, scrolling;

    $('#scroll_up').click(function() {
        //console.log("Up");
        // Scroll the element up

        var topPos = $('#scroller').scrollTop();
        console.log(topPos);    
        $("#scroller").animate({
            scrollTop: topPos - 200
        }, 800);
    });

    $('#scroll_down').click(function() {
        //console.log("Down");
        // Scroll the element down

        var topPos = $('#scroller').scrollTop();
        console.log(topPos);    
        $("#scroller").animate({
            scrollTop: topPos + 200
        }, 800);
    });

    $('#scroll_up, #scroll_down').bind({
        click: function(e) {
            // Prevent the default click action
            e.preventDefault();
        },
        mouseleave: function() {
            if (scrolling) {
                window.clearInterval(scrolling);
                scrolling = false;
            }
        }
    });
});


4

1 回答 1

3

您应该尝试删除(或注释掉)代码中的任何 console.log() 引用。

如果没有开发人员工具,打开 IE 会因为控制台不存在而出现问题。使用开发人员工具打开控制台确实存在,因此不会引发错误。我曾经花了很长时间尝试调试类似的问题:)

于 2013-04-23T20:00:34.477 回答