Bootstrap 下拉菜单链接不可点击 [英] Bootstrap dropdown menu links not clickable

查看:71
本文介绍了Bootstrap 下拉菜单链接不可点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个页面:http://www.poh.me/nordisk/此页面上的下拉菜单链接有效,但子链接(例如 http://www.poh.me/nordisk/contact/) 锚点变得不可点击.

I have a page: 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/) the anchors becomes unclickable.

我已经尝试了从从链接中删除数据切换到 z-index css 以及我从其他有类似问题的其他人那里读到的其他提示的所有方法.

I've tried every thing from removing data-toggle from the links to z-index css and other tips I read from others having a similar problem.

非常感谢任何帮助:-)

Any help is much appreaciated :-)

谢谢!!

推荐答案

您的代码中有错误:

未捕获的类型错误:无法读取未定义的属性 'top'

$(".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');
});

这篇关于Bootstrap 下拉菜单链接不可点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆