【发布时间】:2013-06-27 08:56:02
【问题描述】:
我已经在jsFiddle 上设置了我的问题示例: 也可以全屏查看,因为示例是responsive:
当我在激活 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
}
});
});
【问题讨论】:
标签: jquery mobile menu navigation