我已经在jsFiddle上设置了我的问题的这个例子:也可以全屏查看它,因为这个例子是响应式的:
当我在激活 mmenu 时单击菜单项后会发生什么,滚动跳转到随机锚点,而不是正确的锚点。有人可以帮忙吗?
我有 jquery 1.9.1、mmenu.js 和 jqueryeasing,这些是内联脚本
$(function() {
$('nav ul li a').bind('click',function(event){
var $anchor = $(this);
$('html, body').stop().animate({
scrollTop: $($anchor.attr('href')).offset().top
}, 1000,'easeInOutExpo');
event.preventDefault();
});
});
$(function() {
$('nav#nav').mmenu({
configuration: {
// For some odd reason, the header won't stay "fixed"
// when using hardware acceleration
hardwareAcceleration: false
}
});
});