国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

jQuery實現菜單欄導航效果

2019-11-19 15:48:09
字體:
來源:轉載
供稿:網友

本文實例為大家分享了jQuery實現菜單欄導航效果的具體代碼,供大家參考,具體內容如下

<!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;    }    /*設置位置*/   .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();/*顯示收藏的菜單內容*/     $(".customer,.sell").hide();/*隱藏其他的菜單內容*/    },function(){     $(".shoucang").hide();/*鼠標離開,收藏的菜單內容隱藏*/    });    $(".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(){/*鼠標放置在div位置上,顯示下拉菜單*/     $(this).show();    },function(){/*鼠標離開在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>   </ul>   <div class="shoucang position">    <p>收藏的寶貝</p>    <p>收藏的店鋪</p>   </div>   <div class="sell position">    <p>免費開店</p>    <p>已出售的報寶貝</p>    <p>出售中的報寶貝</p>    <p>賣家服務市場</p>   </div>   <div class="customer position">    <p>消費者客服</p>    <p>賣家客服</p>   </div>  </div> </body></html>

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持武林網。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 盐亭县| 伽师县| 英超| 固原市| 哈密市| 朝阳县| 宜君县| 红桥区| 凉城县| 吉木萨尔县| 漳州市| 南江县| 禄劝| 新竹市| 蒲城县| 阜新市| 澄江县| 灌南县| 资中县| 务川| 赤峰市| 西安市| 朝阳市| 沭阳县| 耒阳市| 郁南县| 屯昌县| 淮阳县| 萨迦县| 信宜市| 正镶白旗| 新沂市| 焉耆| 抚州市| 高尔夫| 全南县| 晴隆县| 河池市| 和硕县| 水城县| SHOW|