$( function() { //主题动画 var $wrap=$("#topicwrap"), $pages=$("#product_list").find(".product_box"), $controlbox=$("#control_box"), $productbtns=$("#product_btns"), $controls=$controlbox.find("a"), $icline=$("#ic_line"), $listtops=$("#list_top").find("li"), $hnav=$("#h_nav"), $hnavli=$hnav.find("li"), $hsubnav=$("#h_subnav"), $hsubdd=$hsubnav.find("dd"), $hbdot=$("#h_bdot"), $hsdot=$("#h_sdot"), $footer=$("#footer"), $bgs=$pages.find(".bg_box img"), $mainboxs=$pages.find(".main_box"), $morenav=$("#more_nav"), $rptbg=$("#rpt_bg"); var data={ plength:$pages.length, curp:0, iscan:true, isonbtn:false, fcolor:[2,2,1,1,1], dur: 8000, cnum:0 }; var add=$controls.eq(0).width()+parseint($controls.eq(0).css("margin-right").slice(0,-2))*2; var cid; var iscss3=function(){ var style=document.createelement("div").style; for(var k in style){ if(k.tolowercase().indexof("animation")>0){ return true; } } return false; }(); var isie6=navigator.useragent.indexof("msie 6.0") > 0; //页面自缩放 var resize=function(){ var w=$(window).width(), h=$(window).height(); $wrap.height(h); $morenav.height(h); if(w/h<1920/1080){ $bgs.height(h).css({width:"auto",margin:-.5*h+"px 0 0 "+-.5*1920/1080*h+"px"}); }else{ $bgs.width(w).css({height:"auto",margin:-.5*w*1080/1920+"px 0 0 "+-.5*w+"px"}); } var imgh=$bgs.height(); //$mainboxs.height(imgh).css("margin-top",-.5*imgh+"px"); var cls; if(iscss3){ document.getelementbyid("topicwrap").classname="topicwrap big_view xbig"; switch(true){ case w>=1920:{cls="";break;} case w<1920&&w>=1680:{cls="small9";break;} case w<1680&&w>=1600:{cls="small8";break;} case w<1600&&w>=1536:{cls="small7";break;} case w<1536&&w>=1440:{cls="small6";break;} case w<1440&&w>=1366:{cls="small5";break;} case w<1366&&w>=1280:{cls="small4";break;} case w<1280&&w>=1024:{cls="small3";break;} case w<1024:{cls="small2";break;} } for(var i=0;i=1600:{cls="big_view";break;} case w<1600&&w>=1440:{cls="mid_view";break;} case w<1440:{cls="small_view";break;} } var ws=$wrap[0].classname; if(isie6&&(ws.indexof("big")!=-1||ws.indexof("mid")!=-1||ws.indexof("small")!=-1)&&ws.indexof(cls)==-1) location.reload(); wrap.classname="wrap "+cls; } add=$controls.eq(0).width()+parseint($controls.eq(0).css("margin-right").slice(0,-2))*2; }; $(window).resize(resize); resize(); var pagechange=function(idx){ if(data.isonbtn) return; if(idx>=-1&&idx0){ bottomhide(); } else{ bottomshow(); } }); cid=setinterval(function(){ pagechange((data.curp+1)%data.plength); },data.dur); //导航事件 $("#nav_more").on("mouseenter",function(){ $morenav.addclass("show"); }); $morenav.on("mouseleave",function(){ $morenav.removeclass("show"); $hbdot.css({left:-9999,top:106}); }) $hnavli.on("mouseenter",function(){ $hbdot.css({left:18,top:106+$hnavli.index(this)*69}); }); $hnav.on("mouseleave",function(){ $hbdot.css({left:-9999}); }); $hsubnav.find("dt").on("mouseenter",function(){ $hbdot.css({left:18}); $hsdot.css({left:-9999}); }); $hsubdd.on("mouseenter",function(){ $hsdot.css({left:18,top:53+$hsubdd.index(this)*44}); $hbdot.css({left:-9999}); }); $hsubnav.on("mouseleave",function(){ $hsdot.css({left:-9999}); }); });