$(document).ready(function(){ var movetime=500; var maxw=300; var avgw= parseInt(97); var index; var t=false; //延时执行 var _this; //标记当前 function cur(ele){ ele=$(ele)? $(ele):ele; ele.addClass("active").siblings().removeClass("active"); }; $(".nav .menu-li:eq(0)").addClass("active").animate({"width":maxw+"px"}); $(".nav").find(".menu-li").mouseover(function(){ _this=$(this); index=$( ".nav .menu-li" ).index( $(this)[0] ); var act=function (){ _this.siblings(".menu-li").removeClass("active"); _this.animate({"width":maxw+"px"},{duration:movetime,easing:"easeOutQuart",complete:function(){cur(_this)}}).siblings(".menu-li").animate({"width":avgw+"px"},{duration:movetime}) } t=setTimeout(act,200); return false; }).mouseout(function(){ if(t){ clearTimeout(t); } }); /*$("#box").Tab({ Obutton : true });*/ $(".p1_1 div").mouseover(function(){ $(".p1_1 div").removeClass("mark"); $(".p1_1 div").eq($(this).index()).addClass("mark"); }); $(".p1_1 div").mouseout(function(){ $(".p1_1 div").removeClass("mark"); }); $(".p2_3 img").eq(0).css("float","left"); $(".p2_3 img").eq(1).css("float","right"); })