$(document).ready(function(){ $(".s-mid-top-title-li").mouseenter(function(){ $("#s-mid-top-content0").hide(); $("#s-mid-top-content1").hide(); $("#s-mid-top-content2").hide(); $("#s-mid-top-content3").hide(); var nowindex="url(/templets/style//templets/default/images/s-mid-top-title"+$(this).index()+".png)"; var nowdiv="#s-mid-top-content"+$(this).index(); $("#s-mid-top-title").css("background-image",nowindex); $(nowdiv).show(); }); }); function banner(){ var bn_id = 0; var bn_id2= 1; var speed33=5000; var qhjg = 1; var MyMar33; $("#banner .d1").hide(); $("#banner .d1").eq(0).fadeIn("slow"); if($("#banner .d1").length>1) { $("#banner_id li").eq(0).addClass("nuw"); function Marquee33(){ bn_id2 = bn_id+1; if(bn_id2>$("#banner .d1").length-1) { bn_id2 = 0; } $("#banner .d1").eq(bn_id).css("z-index","2"); $("#banner .d1").eq(bn_id2).css("z-index","1"); $("#banner .d1").eq(bn_id2).show(); $("#banner .d1").eq(bn_id).fadeOut("slow"); $("#banner_id li").removeClass("nuw"); $("#banner_id li").eq(bn_id2).addClass("nuw"); bn_id=bn_id2; }; MyMar33=setInterval(Marquee33,speed33); $("#banner_id li").click(function(){ var bn_id3 = $("#banner_id li").index(this); if(bn_id3!=bn_id&&qhjg==1) { qhjg = 0; $("#banner .d1").eq(bn_id).css("z-index","2"); $("#banner .d1").eq(bn_id3).css("z-index","1"); $("#banner .d1").eq(bn_id3).show(); $("#banner .d1").eq(bn_id).fadeOut("slow",function(){qhjg = 1;}); $("#banner_id li").removeClass("nuw"); $("#banner_id li").eq(bn_id3).addClass("nuw"); bn_id=bn_id3; } }) $("#banner_id").hover( function(){ clearInterval(MyMar33); } , function(){ MyMar33=setInterval(Marquee33,speed33); } ) } else { $("#banner_id").hide(); } }