最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

jQuery实现菜单栏导航效果

来源:动视网 责编:小OO 时间:2020-11-27 22:32:50
文档

jQuery实现菜单栏导航效果

本文实例为大家分享了jQuery实现菜单栏导航效果的具体代码,供大家参考,具体内容如下:<,.sell").hide();/*隐藏其他的菜单内容*/ },function(){ $(".shoucang").hide();/*鼠标离开,收藏的菜单内容隐藏*/ });$(".li2").hover(function(){ $(".sell").show();$(".customer,.shoucang").hide();},function(){ $(".sell").hide();});$(".li3").hover(function(){ $(".customer").show();$(".shoucang,.sell").hide();},.shoucang p。
推荐度:
导读本文实例为大家分享了jQuery实现菜单栏导航效果的具体代码,供大家参考,具体内容如下:<,.sell").hide();/*隐藏其他的菜单内容*/ },function(){ $(".shoucang").hide();/*鼠标离开,收藏的菜单内容隐藏*/ });$(".li2").hover(function(){ $(".sell").show();$(".customer,.shoucang").hide();},function(){ $(".sell").hide();});$(".li3").hover(function(){ $(".customer").show();$(".shoucang,.sell").hide();},.shoucang p。


本文实例为大家分享了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>

文档

jQuery实现菜单栏导航效果

本文实例为大家分享了jQuery实现菜单栏导航效果的具体代码,供大家参考,具体内容如下:<,.sell").hide();/*隐藏其他的菜单内容*/ },function(){ $(".shoucang").hide();/*鼠标离开,收藏的菜单内容隐藏*/ });$(".li2").hover(function(){ $(".sell").show();$(".customer,.shoucang").hide();},function(){ $(".sell").hide();});$(".li3").hover(function(){ $(".customer").show();$(".shoucang,.sell").hide();},.shoucang p。
推荐度:
标签: 导航 菜单 实现
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top