我有一些这样的 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: Cannot read property 'top' of undefined 的错误
有人可以告诉我有什么问题吗?