Bootstrap 下拉菜单链接不可点击
Bootstrap dropdown menu links not clickable
我有一个页面:http://www.poh.me/nordisk/ where the dropdown menu links on this page works, but the subslinks (e.g. http://www.poh.me/nordisk/contact/) 锚变得不可点击。
我已经尝试了从链接中删除数据切换到 z-index css 以及我从其他有类似问题的人那里读到的其他技巧。
非常感谢任何帮助:-)
谢谢!!
您的代码有错误:
Uncaught TypeError: Cannot read property 'top' of undefined
$(".links a, .nav a").click(function (event) {
event.preventDefault();
var dest = 0;
// Error here
// vvvv
if ($(this.hash).offset().top > $(document).height() - $(window).height()) {
dest = $(document).height() - $(window).height();
} else {
dest = $(this.hash).offset().top;
}
$('html,body').animate({scrollTop: dest}, 800, 'swing');
});
我有一个页面:http://www.poh.me/nordisk/ where the dropdown menu links on this page works, but the subslinks (e.g. http://www.poh.me/nordisk/contact/) 锚变得不可点击。
我已经尝试了从链接中删除数据切换到 z-index css 以及我从其他有类似问题的人那里读到的其他技巧。
非常感谢任何帮助:-)
谢谢!!
您的代码有错误:
Uncaught TypeError: Cannot read property 'top' of undefined
$(".links a, .nav a").click(function (event) {
event.preventDefault();
var dest = 0;
// Error here
// vvvv
if ($(this.hash).offset().top > $(document).height() - $(window).height()) {
dest = $(document).height() - $(window).height();
} else {
dest = $(this.hash).offset().top;
}
$('html,body').animate({scrollTop: dest}, 800, 'swing');
});