Bootstrap dropdown menu does not work

0

I'm developing a web application and I'm using the bootstrap dropdown menu but it does not work

My <head></head>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script><scriptsrc="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/bootstrap/bootstrap.min.js"></script>


    <script src="js/jquery-1.12.0.min.js" type="text/javascript"></script>
    <script src="js/jquery.maskedinput.js" type="text/javascript"></script>
    <script src="js/jquery.maskedinput.min.js" type="text/javascript"></script>

    <script src="bootstrap/bootstrap.min.js" type="text/javascript"></script>
    <script src="bootstrap/bootstrap.js" type="text/javascript"></script>
    <link rel="stylesheet" href="bootstrap/bootstrap.css">
    <link rel="stylesheet" href="css/css.css" type="text/css">
    <link rel="stylesheet" href="css/font-awesome.min.css" type="text/css"/>
    <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/owl-carousel/1.3.3/owl.carousel.min.css">

  

  </head>

HTML

 <div class="body-wrap" >

      <nav class="navbar navbar-inverse" role="navigation" id="azul">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
        <a class="navbar-brand" ></a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
          <div class="conteudo"><li><a href="#">PAGINA PRINCIPAL</a></li></div> 
          <div class="conteudo"> <li><a href="#">CONTATO</a></li></div>
        <li class="dropdown">
            <div class="conteudo"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">PRODUTOS <b class="caret"></b></a></div>
          <ul class="dropdown-menu">
            <li><a href="#">Camisetas</a></li>
             <li class="divider"></li>
            <li><a href="#">Calças</a></li>
             <li class="divider"></li>
            <li><a href="#">Bermudas</a></li>
          </ul>
        </li>
      </ul>

    </div>
    <!-- /.navbar-collapse -->
  </div>
  <!-- /.container-fluid -->
</nav>

 </div>

JS

$('ul.nav li.dropdown').hover(function() {
 $(this).find('.dropdown-menu').stop(true, true).delay(200).fadeIn(500);
 }, function() {
  $(this).find('.dropdown-menu').stop(true, true).delay(200).fadeOut(500);
 });
    
asked by anonymous 17.10.2017 / 04:10

1 answer

1

Good to several import duplications in your code, it is necessary to make a clean, I took the liberty to make some changes.

  • The problem with being returned 403 - Forbidden is because the URL

    https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/bootstrap/bootstrap.min.js
    

    It was updated and became

    https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js
    
  • You are importing jQuery , Bootstrap and Font Awesome using CDN , so there is no need to import local, removed the lines:

    <script src="js/jquery-1.12.0.min.js" type="text/javascript"></script>
    <script src="bootstrap/bootstrap.min.js" type="text/javascript"></script>
    <script src="bootstrap/bootstrap.js" type="text/javascript"></script>
    <link rel="stylesheet" href="bootstrap/bootstrap.css">
    <link rel="stylesheet" href="css/font-awesome.min.css" type="text/css"/>
    
  • Getting your code.

    $('ul.nav li.dropdown').hover(function() {
      $(this).find('.dropdown-menu').stop(true, true).delay(200).fadeIn(500);
    }, function() {
      $(this).find('.dropdown-menu').stop(true, true).delay(200).fadeOut(500);
    });
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script><!--BOOTSTRAP--><linkrel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> 
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script><!--OUTRASBIBLIOTECAS--><scriptsrc="js/jquery.maskedinput.js" type="text/javascript"></script> 
        <script src="js/jquery.maskedinput.min.js" type="text/javascript"></script> 
            
        <link rel="stylesheet" href="css/css.css" type="text/css">
        <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> 
        
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/owl-carousel/1.3.3/owl.carousel.min.css"> 
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/owl-carousel/1.3.3/owl.theme.min.css"> 
        <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/owl-carousel/1.3.3/owl.carousel.min.js"></script><divclass="body-wrap" >
    
          <nav class="navbar navbar-inverse" role="navigation" id="azul">
      <div class="container-fluid">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
            <a class="navbar-brand" ></a>
        </div>
    
        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
          <ul class="nav navbar-nav">
              <div class="conteudo"><li><a href="#">PAGINA PRINCIPAL</a></li></div> 
              <div class="conteudo"> <li><a href="#">CONTATO</a></li></div>
            <li class="dropdown">
                <div class="conteudo"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">PRODUTOS <b class="caret"></b></a></div>
              <ul class="dropdown-menu">
                <li><a href="#">Camisetas</a></li>
                 <li class="divider"></li>
                <li><a href="#">Calças</a></li>
                 <li class="divider"></li>
                <li><a href="#">Bermudas</a></li>
              </ul>
            </li>
          </ul>
    
        </div>
        <!-- /.navbar-collapse -->
      </div>
      <!-- /.container-fluid -->
    </nav>
    
     </div>
        
    17.10.2017 / 05:17