Bootstrap - 下拉菜单不工作? [英] Bootstrap - dropdown menu not working?

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

问题描述

我的下拉菜单在Bootstrap似乎没有工作 - 任何人都可以提醒我的问题?现在它显示下拉列表,但点击它什么也没做。谢谢!

My dropdown menu in Bootstrap doesnt appear to be working - can anyone alert me to the problem? Right now it displays the dropdown, but clicking it does nothing. Thanks!

JS:

$(document).ready( function() {
$('.dropdown-toggle').dropdown();
});

HTML:

<div class="navbar navbar-fixed-top">
    <div class="navbar-inner">
        <div class="container" style="width: auto;">

            <a class="brand" style="text-indent: 3em" href="#">
                Title
            </a>

            <ul class="nav">
                <li><a href="#">Profile</a></li>
                <li class="active"><a href="#">Statistics</a></li>
                <li><a href="#">Reader</a></li>

                <li class="dropdown" id="menu1">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#menu1">
                    Options
                    <b class="caret"></b>
                    </a>
                    <ul class="dropdown-menu">
                        <li><a href="#">Action</a></li>
                        <li><a href="#">Another action</a></li>
                        <li><a href="#">Something else here</a></li>
                        <li class="divider"></li>
                        <li><a href="#">Separated link</a></li>
                    </ul>
                </li>

            </ul>


        </div>
    </div>
</div>


推荐答案

很抱歉,我无法对您的文章发表评论。

Sorry that I could not comment on your post right away.

如果我正确地告诉你,当你说点击什么都不做时,你是不是指向你的网址?

If I am getting you correctly, when you say that clicking does nothing, do you mean that it does not point to your URL?

在锚标签< a href> 中,它看起来好像没有将您的文件路径传递给 href 属性。因此,将替换为您要链接的文件的实际路径。

In the anchor tag <a href>it looks like you did not pass your file path to the href attribute. So, replace the # with your actual path for the file that you want to link.

    <li><a href="#">Action</a></li>
                <li><a href="action link here">Another action</a></li>
                <li><a href="something else link here">Something else here</a></li>
                <li class="divider"></li>
                <li><a href="seperated link here">Separated link</a></li>

希望这有助于解决您的问题。

I hope this helps with your issue.

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

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