Dropdown submenu in bootstrap not working

I just want to ask why this popup submenu in bootstrap is not working, I just followed the instructions in this link: ( http://getbootstrap.com/2.3.2/components.html ) but still the submenu dropdown didn’t appear in the submenu. By the way, I haven't changed or overridden the classes in CSS.

Here is my code! :)

<li class='dropdown'><a class='dropdown-toggle active' data-toggle='dropdown' href='#'><img src = 'images/forbank.png' height = 35 width = 35>Banking<span class='caret'></span></a>
                <ul class='dropdown-menu'>
                    <li class = 'dropdown-submenu'><a tabindex='-1' href='#'><span class = 'glyphicon glyphicon-cog'> </span>  Transaction</a>
                        <ul class='dropdown-menu' role = 'menu'>
                            <li><a tabindex='-1' href='#'> Withdrawal / Deposit </a></li>
                            <li><a tabindex='-1' href='#'> Fixed Deposit </a></li>
                        </ul>
                    </li>
                    <li role='separator' class='divider'></li>
                    <li><a href='#'><span class='glyphicon glyphicon-list-alt'> </span> Summaries </a></li>
                    <li><a href='#'><span class='glyphicon glyphicon-wrench'> </span>  Settings </a></li>
                </ul>
            </li>

      

+3


source to share


2 answers


Please check if your instructions you provided match your boot version.

Alternatively, you can try to include those few lines of CSS to make them work.



.dropdown-submenu {
    position: relative;
}

.dropdown-submenu>.dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -6px;
    margin-left: -1px;
    -webkit-border-radius: 0 6px 6px 6px;
    -moz-border-radius: 0 6px 6px;
    border-radius: 0 6px 6px 6px;
}

.dropdown-submenu:hover>.dropdown-menu {
    display: block;
}

.dropdown-submenu>a:after {
    display: block;
    content: " ";
    float: right;
    width: 0;
    height: 0;
    border-color: transparent;
    border-style: solid;
    border-width: 5px 0 5px 5px;
    border-left-color: #ccc;
    margin-top: 5px;
    margin-right: -10px;
}

.dropdown-submenu:hover>a:after {
    border-left-color: #fff;
}

.dropdown-submenu.pull-left {
    float: none;
}

.dropdown-submenu.pull-left>.dropdown-menu {
    left: -100%;
    margin-left: 10px;
    -webkit-border-radius: 6px 0 6px 6px;
    -moz-border-radius: 6px 0 6px 6px;
    border-radius: 6px 0 6px 6px;
}

      

+7


source


I did this, but the problem is that the submenu for Withdrawal / Deposit and Fixed Deposit is blocking the parent Transaction submenu, it doesn't go to the right of it when it hangs. Here is my code now.



        <li class='dropdown'><a id = 'dLabel' class='dropdown-toggle active' data-toggle='dropdown' href='#'><img src = 'images/forbank.png' height = 35 width = 35>Banking<span class='caret'></span></a>
            <ul class='dropdown-menu multi-level' role='menu' aria-labelledby='dropdownMenu'>
                <li class = 'dropdown-submenu'>
                <a  tabindex = '-1' href='#'><span class = 'glyphicon glyphicon-cog'> </span>  Transaction </a>
                    <ul class='dropdown-menu'>
                        <li><a tabindex='-1' href='#'> Withdrawal / Deposit </a></li>
                        <li><a tabindex='-1' href='#'> Fixed Deposit </a></li>
                    </ul>
                </li>
                <li role='separator' class='divider'></li>
                <li><a href='#'><span class='glyphicon glyphicon-list-alt'> </span> Summaries </a></li>
                <li><a href='#'><span class='glyphicon glyphicon-wrench'> </span>  Settings </a></li>
            </ul>
        </li>

      

0


source







All Articles