Making my menu work on all pages

2

On my system, I have a menu that works perfectly, however I'm trying to include a dropdown, with more links, the dropdown works only when I'm on the menu page, when I'm on other pages, the dropdown does not work. Example: When I open the menu.php, the drop, it works, when I go to any other page, the links work normally, only the drop that does not.

<!DOCTYPE html>
<html>
 <head>
  <meta http-equiv=Content-Type content="text/html; charset=utf-8"> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <title> Menu </title>
  <link rel="stylesheet" href="css/bootstrap.min.css">
  <script type="text/javascript"  src="js/jquery.min.js"></script>
  <script type="text/javascript"  src="js/bootstrap.min.js"></script>
  <script type="text/javascript"  src="js/comandos.js"></script>
  <link rel="stylesheet" href="css/menu.css">
  <link rel="stylesheet" href="css/mobile/portrait.css" media="screen and (orientation: portrait)">
  <link rel="stylesheet" href="css/mobile/landscape.css" media="screen and (orientation: landscape)">
 </head>
 <body onmousemove="acao();"> <!-- Função acao() faz verificação de ociosidade no painel, após determinado tempo ele fecha. -->
   <div class="container-fluid">
    <nav class="navbar navbar-expand-sm bg-dark navbar-dark ">
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
        <span class="navbar-toggler-icon"></span>
      </button>
      <div class="collapse navbar-collapse "id="collapsibleNavbar">
        <ul class="navbar-nav">
          <li class="nav-item ">
            <a class="nav-link" href="inicio.php"><img src="logo/geral.png" /> Início</a>
          </li>
          <li class="nav-item <?php echo $show; ?>">
            <a class="nav-link" href="requisicao.php"><img src="logo/abastecimento.png" /> Abastecimento</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="dashboard.php"><img src="logo/relatorio.png" /> Relatórios</a>
          </li>
          <li class="nav-item ">
            <a class="nav-link" href="descontos.php" ><img src="logo/desconto.png" /> Descontos</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="diaria.php"><img src="logo/diaria.png" /> Diária/Lanche</a>
          </li>
          <li class="nav-item <?php echo $show; ?>">
            <a class="nav-link" href="postos.php"><img src="logo/posto.png" /> Postos</a>
          </li>
          <li class="nav-item ">
            <a class="nav-link" href="exames.php" ><img src="logo/exames.png" /> Exames</a>
          </li>
          <li class="nav-item  <?php echo $show; ?>">
            <a class="nav-link" href="conferencia.php" ><img src="logo/lupa.png" /> Conferencia</a>
          </li>
          <li class="nav-item  <?php echo $show; ?>">
            <a class="nav-link" href="configuracoes.php" ><img src="logo/outros.png" /> Configurações</a>
          </li>
          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" href="#" id="navbardrop" data-toggle="dropdown">Descontos</a>
            <div class="dropdown-menu">
              <a class="dropdown-item" href="diaria.php">Link 1</a>
              <a class="dropdown-item" href="exames.php">Link 2</a> 
            </div>
          </li>
        </ul>
      </div>
      <div class="sair">
        <a href="func/f_parametros.php?func=sair"><img src="logo/sair.png" /> Sair</a>
      </div>
    </nav>
  </div>
 </body>
</html>
    
asked by anonymous 15.06.2018 / 14:12

1 answer

1

Are you using any framework to do this? I think you're forgetting to add some of these lines to <head> of other pages:

    <link rel="stylesheet" href="css/bootstrap.min.css">
    <script type="text/javascript"  src="js/jquery.min.js"></script>
    <script type="text/javascript"  src="js/bootstrap.min.js"></script>
    <script type="text/javascript"  src="js/comandos.js"></script>
    <link rel="stylesheet" href="css/menu.css">
    <link rel="stylesheet" href="css/mobile/portrait.css" media="screen and (orientation: portrait)">
    <link rel="stylesheet" href="css/mobile/landscape.css" media="screen and (orientation: landscape)">
    
15.06.2018 / 15:08