$('a.topSlideMenu').on('click',function(){if($('.topSlideMenuList').is(':visible')){$('.topSlideMenuList').hide();}else{$('.topSlideMenuList').show();} return false;});autoSize=function(){if($('.bannerArea li').length>0){var win=$(window),winW=win.width(),bannerArea=$('.bannerArea'),ul=bannerArea.find('ul'),allLi=ul.children(),len=allLi.length,liW,ulW;winW=win.outerWidth();allLi=ul.children();if(winW>1600){liW=winW/4;if(len>4){$('.bannerBts').show();}else{$('.bannerBts').hide();}}else if(winW>=800){liW=winW/4;if(len>4){$('.bannerBts').show();}else{$('.bannerBts').hide();} if(winW<1000){$('.bannerArea li .txt').hide();}else{$('.bannerArea li .txt').show();}}else{liW=winW/2;if(len>2){$('.bannerBts').show();}else{$('.bannerBts').hide();} if(winW<600){$('.bannerArea li .txt').hide();}else{$('.bannerArea li .txt').show();}} ulW=Math.round(len*liW+1);allLi.width(liW);ul.width(ulW);bannerArea.show();}} $(function(){$lks=$('#lookmslide'),$ul=$lks.find('ul'),$li=$lks.find('li'),$liw=$li.width(),$ulw=Math.round($li.length*$liw);var $prev=$('.bannerBts .prev'),$next=$('.bannerBts .next'),currIndex=0,s=1;var img=$lks.find('img').eq(0);if(!img.complete){img.load(function(){$lks.height($li.outerHeight(true)+$(".bannerBts").height()+20);$ul.height($lks.find('li').outerHeight(true));})} $lks.height($li.outerHeight(true)+$(".bannerBts").height()+20);$ul.height($lks.find('li').outerHeight(true));var zs=Math.floor($li.length/s);var showItmes=Math.round($lks.width()/$liw);var b=$li.length-showItmes;$(window).resize(function(){$lks=$('#lookmslide'),$ul=$lks.find('ul'),$li=$lks.find('li'),$liw=$li.width(),$ulw=Math.round($li.length*$liw);var $prev=$('.bannerBts .prev'),$next=$('.bannerBts .next');$lks.height($li.outerHeight(true)+$(".bannerBts").height()+20);$ul.height($lks.find('li').outerHeight(true)) var zs=Math.floor($li.length/s);showItmes=Math.round($lks.width()/$liw);var jdcurrIndex=Math.abs(currIndex);var b=$li.length-showItmes;var l=$liw*s*currIndex;if(jdcurrIndex/b>1){l=0;currIndex=0;} $ul.animate({left:l},30);});var prev_=function(){if(!$ul.is(':animated')){if(currIndex==0){$(this).removeClass('here');return false;} currIndex++;var ri=$liw*s*currIndex;$ul.animate({left:ri},500,function(){$next.addClass('here');if(currIndex==0){$prev.removeClass('here');}});}} $prev.click(function(){prev_();return false;});var next_=function(){if(!$ul.is(':animated')&&Math.abs(currIndex)!=b){var jdcurrIndex=Math.abs(currIndex);currIndex--;var lf=$liw*s*currIndex;console.log(currIndex);$ul.animate({left:lf},500,function(){$prev.addClass('here');if(Math.abs(currIndex)==b){$next.removeClass('here');}});}};$next.click(function(){next_();return false;});var chapman={};chapman.move_startX=0;chapman.move_startY=0;chapman.move_e_touch=null;chapman.touchDown=false;function openTouch(){$lks.on('touchstart',function(e){page_touchstart($(this),e);});$lks.on('touchmove',function(e){page_touchmove($(this),e);});$lks.on('touchend',function(e){page_touchend($(this),e);});} openTouch();function page_touchstart(this_,e){chapman.touchDown=true;if(e.originalEvent.targetTouches[0].pageX){chapman.move_e_touch=e.originalEvent.targetTouches[0];}else{chapman.move_e_touch=e.targetTouches[0];} chapman.move_startX=chapman.move_e_touch.pageX;} function page_touchmove(this_,e){if(chapman.touchDown!=true){e.preventDefault();return false;} e.preventDefault();if(e.originalEvent.targetTouches[0].pageX){chapman.move_e_touch=e.originalEvent.changedTouches[0];}else{chapman.move_e_touch=e.targetTouches[0];} chapman.move_endX=chapman.move_e_touch.pageX;var _bothNum=chapman.move_endX-chapman.move_startX;if(_bothNum<-50){chapman.move_startX=0;chapman.move_endX=0;next_();}else if(_bothNum>50){chapman.move_startX=0;chapman.move_endX=0;prev_();} return false;} function page_touchend(this_,e){if(chapman.touchDown!=true){e.preventDefault();return false;} chapman.touchDown=false;} $('.upbox').waypoint(function(){$(this).addClass('appear-up');},{triggerOnce:true,offset:'100%'});$('.ilxwm-left').waypoint(function(){$(this).addClass('appear-left');},{triggerOnce:true,offset:'100%'});$('.ilxwm-right').waypoint(function(){$(this).addClass('appear-right');},{triggerOnce:true,offset:'100%'});autoSize();$(window).resize(function(){autoSize();});$(window).scroll(function(){if($(this).scrollTop()>100){$('#tips').fadeOut()}});});