<!DOCTYPE html><html><head> <title></title> <meta charset="utf-8"> <style type="text/css">? ? ? ?.navList{? ? ? ? position: absolute;? ? ? ? top: 10px;? ? ? ?}? ? ? ?a{? ? ? ? text-decoration:none;? ? ? ? color: white;? ? ? ?}? ? ? ?.navList a {? ? ? ? margin-left: 60px;? ? ? ? color: #666;? ? ? ?}? ? ? ?.expand{? ? ? ? height:0px;? ? ? ? background-color: #333d4d;? ? ? ? overflow: hidden;? ? ? ? position: relative;? ? ? ? top: 30px;? ? ? ? width: 100%;? ? ? ?}? ? ? ?.expdiv{? ? ? ? height: 130px;? ? ? ? width: 500%;? ? ? ?}? ? ? ?.expdiv-list{? ? ? ? width: 20%;? ? ? ? text-align: center;? ? ? ? float: left;? ? ? ? line-height: 110px;? ? ? ? color: White;? ? ? ?}? ? ? ?.expand .close-btn{? ? ? ? width: 120px;? ? ? ? height: 20px;? ? ? ? background:url(images/broswer_home.png) no-repeat -13px -117px;? ? ? ? position: absolute;? ? ? ? left: 50%;? ? ? ? bottom: -2px;? ? ? ? margin-left: -60px;? ? ? ? cursor: pointer;? ? ? ?} </style>? ?<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>? ?<script type="text/javascript">? ? ? ? $(document).ready(function(){? ? ? ? ? $("#menuList").on("click","a",function(){? ? ? ? ? ? ? if($(this).hasClass("btn-active")){? ? ? ? ? ? ? ? ?$("#expandZone #close-Btn").click();? ? ? ? ? ? ? ? ?return false;? ? ? ? ? ? ? }? ? ? ? ? ? ? var curIndex=$(this).index();? ? ? ? ? ? ? var mlValue="-"+curIndex*100+"%";? ? ? ? ? ? ? if($("#expandZone").hasClass("active")){? ? ? ? ? ? ? ? $(".expdiv").animate({marginLeft:mlValue});? ? ? ? ? ? ? }? ? ? ? ? ? ? else{? ? ? ? ? ? ? ? $("#expandZone .expdiv").css({marginLeft:mlValue});? ? ? ? ? ? ? ? $("#expandZone").animate({height:"130px"}).addClass("active");? ? ? ? ? ? } ?? ? ? ? ? ? ? ?$("this").addClass("btn-active").siblings().removeClass("btn-active");? ? ? ? ? ? ? ?return false;? ? ? ? ? ? ? ? });? ? ? ? ? ? ??? ? ? ? ? ? ? ?$("#expandZone #close-Btn").on("click",function(){? ? ? ? ? ? ? ? ? ?$("#expandZone").animate({height:"0px"},function(){? ? ? ? ? ? ? ? ? $(this).removeClass("active");?? ? ? ? ? ? ? ? ? $("#menuList .btn-active").removeClass("btn-active");? ? ? ? ? ? ? ? });? ? ? ? ? ? ? ? ? ?return false;? ? ? ? ? ? ?});? ? ? ? ? });? ? ? ? ? ? ? ?? ?</script></head><body>? ? <div id="menuList" class="navList">? ? ?<a href="#">首頁(yè)</a>? ? ?<a href="#">課程大廳</a>? ? ?<a href="#">學(xué)習(xí)中心</a>? ? ?<a href="#">你的信息</a>? ? ?<a href="#">關(guān)于我們</a>? ? </div>? ? <div id="expandZone" class="expand">? ? <div class="expdiv">? ? ? ?<div class="expdiv-list">? ? ? ? ? ?<a href="#">關(guān)于我們1</a>? ? ? ?</div>? ? ? ?<div class="expdiv-list">? ? ? ? ? ?<a href="#">反反復(fù)復(fù)2</a>? ? ? ?</div>? ? ? ?<div class="expdiv-list">? ? ? ? ? ?<a href="#">vvv1</a><a href="#">關(guān)vv2</a><a href="#">關(guān)vvvss</a>?? ? ? ?</div>? ? ? ?<div class="expdiv-list">? ? ? ? ? ?<a href="#">關(guān)刪除們1</a><a href="#">關(guān)vv</a><a href="#">防水層們</a>? ? ? ?</div>? ? ? ?<div id="close-Btn" class="close-btn">? ? ? ? ? ?? ? ? ?</div>? ? </div>? ? <div></div>? ? </div></body></html>這條代碼有什么作用??我感覺(jué)可以不要這條程序的
$("this").addClass("btn-active").siblings().removeClass("btn-active"); 這個(gè)代碼有什么用?
周磊磊磊
2017-09-21 22:09:19