Error using two dropdown menus

Asked

Viewed 63 times

0

I have two menus and when I click 1 the 2 are triggered. How am I supposed to fix this?

<div class="row">
                <div class="btn btn-group pull-right">
                    <!-- Inicio Menu DropDown -->
                    <button type="button" class="btn btn-danger">Equipamento</button>
                    <button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                    <span class="caret"></span>
                    <span class="sr-only">Toggle Dropdown</span>
                    </button>
                    <ul class="dropdown-menu" role="menu">
                        <li><a href="inventario.php">Inventário</a></li>
                        <li><a  href="material-hist.php">Hist Material OS</a></li>
                        <li><a  href="material-lista.php" alt="Edição de Material por OS" title="Edição de Material por OS">Edição Equipamento</a></li>
                    </ul>
                    <!-- Fim Menu DropDown -->                       

                    <!-- Inicio Menu DropDown -->
                    <button type="button" class="btn btn-danger">OS</button>
                    <button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                    <span class="caret"></span>
                    <span class="sr-only">Toggle Dropdown</span>
                    </button>
                    <ul class="dropdown-menu" role="menu">
                      <li><a href="os-lista.php">Lista de OS</a></li>
                      <li><a href="custo-setor.php">Custo por Setor</a></li>                        
                    </ul>
                    <!-- Fim Menu DropDown -->


                    <a href="logout.php" class="btn btn-danger"><span class="glyphicon glyphicon-share-alt">&nbsp;Sair</span></a>

                </div>
            </div>

inserir a descrição da imagem aqui

1 answer

1


Grouping the button groups works:

<div class="btn-group pull-right">
            <!-- Inicio Menu DropDown -->
            <button type="button" class="btn btn-danger">Equipamento</button>
            <div class="btn-group">
                <button id="btn1" type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                    <span class="caret"></span>
                    <span class="sr-only">Toggle Dropdown</span>
                </button>
                <ul class="dropdown-menu" role="menu" aria-labelledby="btn1">
                    <li><a href="inventario.php">Inventário</a></li>
                    <li><a  href="material-hist.php">Hist Material OS</a></li>
                    <li><a  href="material-lista.php" alt="Edição de Material por OS" title="Edição de Material por OS">Edição Equipamento</a></li>
                </ul>
            </div>
            <div class="btn-group">
                <!-- Fim Menu DropDown -->     

                <!-- Inicio Menu DropDown -->
                <button type="button" class="btn btn-danger">OS</button>
                <button id="btn2" type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                    <span class="caret"></span>
                    <span class="sr-only">Toggle Dropdown</span>
                </button>
                <ul class="dropdown-menu" role="menu" aria-labelledby="btn2">
                    <li><a href="os-lista.php">Lista de OS</a></li>
                    <li><a href="custo-setor.php">Custo por Setor</a></li>                        
                </ul>
                <!-- Fim Menu DropDown -->
            </div>
            <a href="logout.php" class="btn btn-danger"><span class="glyphicon glyphicon-share-alt">&nbsp;Sair</span></a>

        </div>
  • But now everything is separate. You must have another form-group to put it all together?

  • yes, I’ll edit, group them into new btn-groups

  • http://imgur.com/a/WBGLx

  • edited the answer, look if that’s it

  • Thank you very much.

Browser other questions tagged

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