var t = a = count = 0; $(function () { var menu=$(".menu li"),navs2=$(".navs2") menu.hover(function(){ var mheight=$(this).find(".navs2 a").size()*$(this).find(".navs2 a").height() $(this).find(".navs2").stop(true).animate({height:mheight},500); },function(){ $(this).find(".navs2").stop(true).animate({height:0},500); }) count = $(".smimg a").size(); var smimg=$(".smimg a"),bigimg=$(".bigimg a"),fast=$(".fast") t = setinterval("showauto()", 5000); $(".smimg,.fast,.bigimg").hover(function(){ clearinterval(t) }, function(){ t = setinterval("showauto()", 5000); }); smimg.hover(function(){ a=$(this).index(); smimg.removeclass("hover").eq(a).addclass("hover"); bigimg.addclass("hide").eq(a).removeclass("hide"); fast.addclass("hide").eq(a).removeclass("hide"); }) $(".newsli a:odd").css({'float':'right'}); }) function showauto() { a = a >= (count - 1) ? 0 : a + 1; $(".smimg a").removeclass("hover").eq(a).addclass("hover"); $(".bigimg a").addclass("hide").eq(a).removeclass("hide"); $(".fast").addclass("hide").eq(a).removeclass("hide"); } $(window).load(function(){ function starttime(){ var today=new date(); var y=today.getyear(); years=y+2000-100 var mon=checktime(today.getmonth()+1); var d=checktime(today.getdate()); var weekday='星期'+'日一二三四五六'.charat(today.getday()); //var h=checktime(today.gethours()); //var m=checktime(today.getminutes()); //var s=checktime(today.getseconds()); document.getelementbyid('time').innerhtml=years+ "年" + mon + "月" + d + "日" + weekday; } function checktime(i){ if (i<10) i="0" + i return i } starttime(); setinterval(starttime,1000); $(".left,.right").css({height:$(".middle").height()}) })