Can anyone help me figure out why the dropdown menu is not working?

Asked

Viewed 38 times

0

<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link href="css/bootstrap.css" rel="stylesheet" type="text/css"/>
        <link href="css/estilo.css" rel="stylesheet" type="text/css"/>
        <!--<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css"/>-->
    </head>
    <body>
        <div class="container">
            <p class="text-center bg-danger">
                Lorem ipsum dolor sit amet
            </p>
        </div>

        <nav>
            <div class="container-fluid">
                <div class="navbar-header">

                    <button type="button" class="navbar-toggle collapse" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                        <span class="sr-only">Menu de navegação</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>

                    <a href="#" class="navbar-brand">jade</a>

                </div>

                <div class="collapse navbar-collapse " id="bs-example-navbar-collapse-1">
                    <ul class="nav navbar-nav">

                        <li><a href="#">Contacto</a></li>
                        <li><a href="#">Sobre</a></li>

                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toogle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Menu</a>
                            <ul class="dropdown-menu">
                                <li><a href="#">Productos</a></li>
                                <li><a href="#">Categorias</a></li>
                                <li><a href="#">Tipo</a></li>
                                <li><a href="#">Sair</a></li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
        </nav>

        <script src="js/jquery-1.11.1.min.js" type="text/javascript"></script>
        <!--<script src="js/bootstrap.min.js" type="text/javascript"></script>-->
        <script src="js/script.js" type="text/javascript"></script>
        <script src="js/bootstrap.js" type="text/javascript"></script>
    </body>
</html>

2 answers

0

As you click on the word Menu appeared the titles, Categories, Type and Exit. and if you click again the data are 'hidden'

<ul class="nav navbar-nav side-nav">
                <li>
                    <a href="javascript:;" data-toggle="collapse" data-target="#demo"> Menu </a>
                    <ul id="demo" class="collapse">
                        <li class="active">
                            <li><a href="#"> Categorias </a></li>
                            <li><a href="#"> Tipo </a></li>
                            <li><a href="#"> Sair </a></li>
                        </li>
                    </ul>
                </li>
</ul>

0

Any mistake however simple can compromise the whole code.

In your case you got the word wrong data-toggle that in your code is data-toogle. It’s just a letter the and two letters g in toggle.

See this error in the following line of your code:

<li class="dropdown">
  <a href="#" class="dropdown-toggle" data-toogle="dropdown" ...>Menu</a>
                                             ^
                                             |

Browser other questions tagged

You are not signed in. Login or sign up in order to post.