未捕获的TypeError:无法读取未定义的属性“top”

时间:2013-07-14 13:11:47

标签: jquery undefined typeerror

我有一些像这样的jQuery代码

$(document).ready(function () {
    $("a.menuLink").click(function () {
        elementClick = $(this).attr("href");
        destination = $(elementClick).offset().top;
        if ($.browser.safari) {
            $('.info').animate({
                scrollTop: destination
            }, 1100);
        } else {
            $('.info').animate({
                scrollTop: destination
            }, 1100);
        }
        return false;
    });
});

当我点击链接(class =“menuLink”)时,我收到类似Uncaught TypeError的错误:无法读取未定义的属性“top”

有人能告诉我什么错了吗?

0 个答案:

没有答案
相关问题