Problems with dropdown menu with bootstrap

0

I made a dropdown menu on my page. When I select the menu the following problems happen: 1) Nothing is selected, that is, I choose the option, but it does not select anything. 2) Even if nothing is selected, the menu is open, closing when I select, and if I click anywhere on the page, it will not return to normal.

This code I got on the net to change it for my use.

My cshtml (view):

<!DOCTYPE html>

<html>
<head>
    <title></title>
    <script src="~/Scripts/jquery-1.10.2.min.js"></script>
    <link href="~/Content/bootstrap.css" rel="stylesheet" />
    <script src="~/Scripts/bootstrap.min.js" type="text/javascript"></script>
    <script src="~/Scripts/bootstrap.js" type="text/javascript"></script>
</head>
<body>
    <div class="navbar navbar-inverse">
        <div class="Container">
            <ul class="nav navbar-nav">
                <li><a href="#">Home</a></li>
                <li><a href="#about">Technologies</a></li>
                <li><a href="#contact">Article</a></li>
                <li><a href="#contact">blog</a></li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle">News <b class="caret"></b></a>
                    <ul class="dropdown-menu">
                        <li><a href="#">Home</a></li>
                        <li><a href="#">Technologies</a></li>
                        <li><a href="#">Article</a></li>
                        <li><a href="#">blog</a></li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
    <script type="text/javascript">
        $(document).ready(function () {
            $('.dropdown-toggle').dropdown();
        });
    </script>

</body>

</html>
    
asked by anonymous 18.07.2014 / 21:40

1 answer

3

Just make the following change:

<a href="#" class="dropdown-toggle" data-toggle="dropdown">

Adding the attribute data-toggle="dropdown"

    
18.07.2014 / 22:14