jQuery實(shí)現(xiàn)菜單欄導(dǎo)航效果
更新時間:2017年08月15日 09:13:17 作者:顧白的顧小白
這篇文章主要為大家詳細(xì)介紹了jQuery實(shí)現(xiàn)簡單菜單欄導(dǎo)航效果,具有一定的參考價值,感興趣的小伙伴們可以參考一下
本文實(shí)例為大家分享了jQuery實(shí)現(xiàn)菜單欄導(dǎo)航效果的具體代碼,供大家參考,具體內(nèi)容如下
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style> *{ padding: 0px; margin: 0px; } #top{width: auto;height: 30px;background: #eee;position: relative;} #top li{float: left; text-align: center; width: 80px; height:30px; line-height:30px; list-style: none; } /*設(shè)置位置*/ .position{ position: absolute; border: 1px solid #ccc; top:30px; padding: 3px; font-size: 15px; display: none; } .shoucang{width: auto;left: 10px;} .sell{width: auto;left: 70px;} .customer{width: auto;left: 180px;} .bg{background-color: #DDA0DD;cursor: pointer;} </style> <script type="text/javascript" src="js/jquery-1.8.3.js" ></script> <script> $(function(){ $(".li1").hover(function(){ $(".shoucang").show();/*顯示收藏的菜單內(nèi)容*/ $(".customer,.sell").hide();/*隱藏其他的菜單內(nèi)容*/ },function(){ $(".shoucang").hide();/*鼠標(biāo)離開,收藏的菜單內(nèi)容隱藏*/ }); $(".li2").hover(function(){ $(".sell").show(); $(".customer,.shoucang").hide(); },function(){ $(".sell").hide(); }); $(".li3").hover(function(){ $(".customer").show(); $(".shoucang,.sell").hide(); },function(){ $(".customer").hide(); }); $("#top div").hover(function(){/*鼠標(biāo)放置在div位置上,顯示下拉菜單*/ $(this).show(); },function(){/*鼠標(biāo)離開在div位置上,隱藏下拉菜單*/ $(this).hide(); }); $(".sell p,.shoucang p,.customer p").bind("mouseover",function(){ $(this).addClass("bg"); }); $(".sell p,.shoucang p,.customer p").bind("mouseout",function(){ $(this).removeClass("bg"); }); }); </script> </head> <body> <div id="top"> <ul> <li class="li1">收藏夾</li> <li class="li2">賣家中心</li> <li class="li3">聯(lián)系客服</li> </ul> <div class="shoucang position"> <p>收藏的寶貝</p> <p>收藏的店鋪</p> </div> <div class="sell position"> <p>免費(fèi)開店</p> <p>已出售的報寶貝</p> <p>出售中的報寶貝</p> <p>賣家服務(wù)市場</p> </div> <div class="customer position"> <p>消費(fèi)者客服</p> <p>賣家客服</p> </div> </div> </body> </html>
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
您可能感興趣的文章:
- 基于jQuery實(shí)現(xiàn)左側(cè)菜單欄可折疊功能
- 最常見的左側(cè)分類菜單欄jQuery實(shí)現(xiàn)代碼
- jquery仿京東導(dǎo)航/仿淘寶商城左側(cè)分類導(dǎo)航下拉菜單效果
- 基于jquery實(shí)現(xiàn)導(dǎo)航菜單高亮顯示(兩種方法)
- jQuery 實(shí)現(xiàn)側(cè)邊浮動導(dǎo)航菜單效果
- jquery實(shí)現(xiàn)點(diǎn)擊向下展開菜單項(xiàng)(伸縮導(dǎo)航)效果
- jQuery實(shí)現(xiàn)的導(dǎo)航下拉菜單效果示例
- JQuery 寫的個性導(dǎo)航菜單
- jQuery仿京東商城樓梯式導(dǎo)航定位菜單
- jquery實(shí)現(xiàn)網(wǎng)頁左側(cè)導(dǎo)航菜單欄
相關(guān)文章
jquery.validate自定義驗(yàn)證用法實(shí)例分析【成功提示與擇要提示】
這篇文章主要介紹了jquery.validate自定義驗(yàn)證用法,結(jié)合實(shí)例形式分析了jQuery成功提示與擇要提示驗(yàn)證操作相關(guān)實(shí)現(xiàn)與使用技巧,需要的朋友可以參考下2020-06-06jquery拖動層效果插件用法實(shí)例分析(附demo源碼)
這篇文章主要介紹了jquery拖動層效果插件用法,結(jié)合實(shí)例形式分析了jquery-ui-1.7.2.custom.min.js插件的具體使用技巧,并附帶完整demo源碼供讀者下載參考,需要的朋友可以參考下2016-04-04