0

私はJquery-1.7を使用しています。以下は私のjqueryコードです。Chrome では動作しますが、IE では失敗します

$(window).bind('scroll', function () {
    if ($(this).attr('scrollY') > $('#footerCenter').offset().top - $(window).height() - 60) {
        if ($('#earthMoonLink').hasClass('more')) {
            $('#earthMoonLink').removeClass('more').text('earth').attr({href: '#Earth', title: 'Back to Top'});
        }

    } else {
        if (!$('#earthMoonLink').hasClass('more')) {
            $('#earthMoonLink').addClass('more').text('moon').attr({href: '#Moon', title: 'Jump to Footer'});
        }
    }
});

IE 9 および 10 で以下のエラーが発生します

SCRIPT438: Object doesn't support property or method 'getElementsByTagName' 
jquery.min.js, line 16 character 59008
SCRIPT5007: Unable to get property 'top' of undefined or null reference 
base.js, line 48 character 9
4

1 に答える 1