1

我已经像这样链接到 jQuery<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>并包含以下脚本:

$(document).ready(function(){
    $('.myLinkToTop').click(function () {
        $('html, body').animate({scrollTop:$(document).height()}, 'slow');
        return false;
    });

    $('.myMenuLink').click(function () {
        $('html, body').animate({scrollTop:0}, 'slow');
        return false;
    });
})

但是该脚本只能在 Firefox 中运行,而不能在 Opera、Chrome 或 Safari 中运行。有什么我错过的吗?

4

0 回答 0