它向我显示此消息:
TypeError:$(...)。offset(...)未定义
当我单击导航栏菜单进入下一页时。
var sticky = $(".isSticky"),
menu_a = $('.mainMenu ul li.scroll > a, .mouseSlider a, .mainMenu_home3 ul li.scroll > a'),
bodyhtml = $('html, body');
win.on('scroll', function(){
if(win.scrollTop() > 300)
{
sticky.addClass('fixedHeader animated slideInDown');
}else
{
sticky.removeClass('fixedHeader animated slideInDown');
}
/*====== Menu Active on Scroll ======*/
Scroll();
Scroll2();
Scroll3();
});
menu_a.on('click', function(){
if($(this).parent().hasClass('has-child'))
{
$(this).parent().children('ul').slideToggle('slow');
}
bodyhtml.animate({scrollTop : $(this.hash).offset().top - 100}, 1000); //I have error this line
return false;
});