function fetchobject(thisobj){ return document.getelementbyid(thisobj); } function nav(thisobj) { for(i=1;i<=9;i++) { var nav=fetchobject("nav"+i); var erji=fetchobject("erji"+i); if(thisobj==i) { nav.classname="active" erji.style.display="block"; } else { nav.classname="" erji.style.display="none"; } } } function xxk(thisobj) { for(i=1;i<=3;i++) { var xxk=fetchobject("xxk"+i); var page=fetchobject("page"+i); var more=fetchobject("more"+i); if(thisobj==i) { xxk.classname="active"; page.style.display="block"; more.style.display="block"; } else { xxk.classname=""; page.style.display="none"; more.style.display="none"; } } } function mouseout(thisobj){ var nav=fetchobject("nav"+thisobj); var erji=fetchobject("erji"+thisobj); erji.style.display="none"; nav.classname=""; } $(function($){ //下拉导航菜单效果 $("#j-head-menu-list > li:has(.subnav)").hover(function(){ var $this = $(this); $this.find("a:eq(0)").addclass("hover").end() .find(".subnav").stop(true, true).slidedown('slow'); },function(){ var $this = $(this); $this.find(".subnav").stop(true, true).slideup("slow",function(){ $this.find("a:eq(0)").removeclass("hover"); }); }); });