Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

jquery drop-down menu (navigation) code summary download


May 07, 2021 jQuery


Table of contents


Drop-down menu or navigation is one of our indispensable site elements in website development, the use of jquery can be produced simple and easy to use, beautiful and generous drop-down menu effects or navigation menu, jquery is a lightweight JavaScript framework, compatible with CSS3 and a variety of mainstream browsers, while there are many mature plug-ins to choose from, can bring users a better experience. H ere are a few good jquery drop-down menus and navigation menu code download resources for reference. Let's start with an example of the code to see how the next underlying drop-down menu is implemented:


First of all, the page refers to .js, the version is unlimited;
The HTML code is as follows:

<div class=”header_menu”>  
        <ul>  
            <li class=”menuli” id=”xtgl_menu”>系统管理</li>  
            <li class=”menuli” id=”ggsq_menu”>干管所勤</li>  
            <li class=”menuli” id=”bhz_menu”>保护站</li>  
            <li class=”menuli” id=”mcjy_menu”>木材检验</li>  
            <li class=”menuli” id=”slgh_menu”>森林管护</li>  
        </ul>  
    </div>  
<div class=”display movedivid=”slgh_menu_div”>  
    <ul>  
        <li class=”redli”>出勤管理</li>  
        <li class=”redli”>巡视管理</li>  
        <li class=”redli”>现场取证</li>  
        <li class=”redli”>问题处置</li>  
    </ul>  
</div>  
<div class=”display movedivid=”mcjy_menu_div”>  
    <ul>  
        <li class=”redli”>位置监测</li>  
        <li class=”redli”>检验管理</li>  
    </ul>  
</div>  
<div class=”display movedivid=”bhz_menu_div”>  
    <ul>  
        <li class=”redli”>出勤管理</li>  
        <li class=”redli”>监管信息</li>  
    </ul>  
</div>  
<div class=”display movedivid=”ggsq_menu_div”>  
    <ul>  
        <li class=”redli”>出勤管理</li>  
        <li class=”redli”>监管信息</li>  
    </ul>  
</div>  
<div class=”display movedivid=”xtgl_menu_div”>  
    <ul>  
        <li class=”redli”>权限管理</li>  
        <li class=”redli”>设备管理</li>  
    </ul>  
</div>  

The css style code is as follows:

/**头部菜单**/  
.header_menu{  
    float:right;  
    width: 50%;  
    height: 100%;  
    cursor: pointer;  
}  
.header_menu ul{  
    list-style: none;  
    height: 100%;  
}  
.header_menu ul li{  
    float: right;  
    width: 20%;  
    color:white;  
    font-size:14px;  
    padding-top: 55px;  
    font-weight: bold;  
}  
.display{  
    display: none;  
}  
.display ul{  
    list-style: none;  
    width: 100px;  
}  
.display ul li{  
    padding-top:10px;  
    padding-bottom: 5px;  
    padding-left:5px;  
    cursor: pointer;  
    font-size: 14px;  
}  
.movediv{  
    position: fixed;  
    left: 0px;  
    top:0px;  
    font-size: 14px;  
    white;  
    border:1px solid white;  
}  
.redcolor{  
    #a0c9e6;  
}  

The js script code is as follows:

$(function() {  
    // 菜单绑定事件  
    initMenuListener();  
    // 下拉菜单绑定事件  
    initSubMenuHover();  
    // 下拉菜单颜色改变  
    initSubMenuLiHover();  
});  
/** 
 * 头部菜单绑定滑过事件 
 */  
function initMenuListener() {  
    $(“.menuli”).hover(function() {  
        var hideDivId = $(this).attr(“id”) + “_div”;  
        // 得到菜单的位置  
        var left = $(this).offset().left;  
        var top = $(this).offset().top;  
        var height = $(this).outerHeight();//outerHeight是获取高度,包括内边距,height是也是获取高度,不过只包括文本高度  
        $(“#” + hideDivId).show();  
        $(“#” + hideDivId).css(“left”, left);  
        $(“#” + hideDivId).css(“top”, top + height);  
    }, function() {  
        // 将原来的菜单隐藏  
        $(“.display”).hide();  
    });  
}  
/** 
 * 下拉菜单绑定事件 
 */  
function initSubMenuHover() {  
    $(“.display”).hover(function() {  
        $(this).show();  
    }, function() {  
        $(this).hide();  
    });  
}  
/** 
 *  下拉菜单改变颜色 
 */  
function initSubMenuLiHover() {  
    $(“.redli”).hover(function() {  
        $(this).addClass(“redcolor”);  
    }, function() {  
        $(this).removeClass(“redcolor”);  
    });  
}  

The page effect is as follows:

jquery drop-down menu (navigation) code summary download


Resource download:


Full-screen large drop-down menu navigation code

The jQuery full-screen large drop-down menu navigation code is an effect that mimics Microsoft's blue atmospheric full-screen website navigation menu.


E-commerce website categorical navigation menu effects
jQuery e-commerce website classified navigation menu effects is a compatible ie8 browser, click on the left drop-down menu to view a list of various products.


Black site navigation drop-down menu code
Script Introduction jQuery Black Site Navigation drop-down menu code is an atmospheric drop-down multi-layer tab navigation bar code.

jquery drop-down menu (navigation) code summary download

Animated drop-down navigation menu code
jQuery animation drop-down navigation menu code is a switch between menu items, the drop-down menu will be based on the size of the menu content dynamic deformation, the effect is very interesting.

jquery drop-down menu (navigation) code summary download


Multi-criteria filtering pull-down selection box code
The jQuery multi-criteria filter drop-down selection box code is a drop-down menu effect download with multiple condition filters

jquery drop-down menu (navigation) code summary download


Hover responds to the drop-down navigation menu bar code
jQuery Hover response drop-down navigation menu bar code is a mouse pass, drop-down display a sub-navigation menu column special effects, exquisite typography, recommended download.

jquery drop-down menu (navigation) code summary download


The input text box clicks on the pull-down selection code
jQuery input text box click drop-down selection code is a mouse click input text box drop-down menu selection code.

jquery drop-down menu (navigation) code summary download


Responsive drop-down navigation menu
The jQuery responsive drop-down navigation menu plug-in megamenu is an IE8-compatible browser that uses jQuery animations as a transition and is responsive and integrates seamlessly with wordpress.
jquery drop-down menu (navigation) code summary download


Adapt to the mobile selection bank pull-down list
jQuery Adapts mobile select bank drop-down list is a choice bank drop-down menu code for mobile.

jquery drop-down menu (navigation) code summary download


The mouse passes through the secondary menu drop-down code
The jQuery mouse through the secondary menu drop-down code is a mouse-over slide-down secondary menu effect based on the jQuery-CSS3 implementation.

jquery drop-down menu (navigation) code summary download


Vertical accordion menu list code
The jQuery vertical accordion menu list code is a user list navigation expansion shrink drop-down menu code based on the jQuery-CSS3 implementation.

jquery drop-down menu (navigation) code summary download


The left drop-down menu code
The site left drop-down menu jQuery code is a blue style suitable for background drop-down menu code.

jquery drop-down menu (navigation) code summary download