点击它外面的关闭移动菜单 - 正文

时间:2018-05-15 16:36:26

标签: jquery

我迫切需要您的宝贵帮助,以便在点击下拉菜单或汉堡图标外部时关闭Helix II框架上的移动菜单。

我的HTML代码:

<div class="body-innerwrapper">
    <a class="hidden-desktop btn btn-inverse sp-main-menu-toggler collapsed" href="#" data-toggle="collapse" data-target=".nav-collapse">
    <i class="icon-align-justify"></i>
    </a>
    <div class="hidden-desktop sp-mobile-menu nav-collapse collapse" style="height: 0px;">
    <ul class="">
    <li class="menu-item active first"><a href="#" class="menu-item active first"><span class="menu"><span class="menu-title">Home</span></span></a></li>
    <li class="menu-item"><a href="#" class="menu-item"><span class="menu"><span class="menu-title">List </span></span></a></li>
    </ul>
    </div>
    </div>

下拉列表时我的CSS代码:

.nav-collapse.collapse {
    height: auto;
    overflow: visible;
}
.collapse.in {
    height: auto;
}
.sp-mobile-menu {
    top: 105px;
    z-index: 999;
}
.sp-mobile-menu {
    position: absolute !important;
    top: 90px;
    left: 0;
    width: 100%;
}
.hidden-desktop {
    display: none!important;
}
.collapse {
    position: relative;
    height: 0;
    overflow: hidden;
    -webkit-transition: height .35s ease;
    -moz-transition: height .35s ease;
    -o-transition: height .35s ease;
    transition: height .35s ease;
}

非常感谢任何帮助。

0 个答案:

没有答案