/* name : yanggang; QQ:392017299; E-mail:yanggang1@conew.com; */ var UA = window.navigator.userAgent,IsAndroid = (/Android|HTC/i.test(UA)),IsIPad = !IsAndroid && /iPad/i.test(UA),IsIPhone = !IsAndroid && /iPod|iPhone/i.test(UA),IsIOS = IsIPad || IsIPhone,clearAnimatea = null; var testStyle=document.createElement('div').style, camelCase=function(str){ return str.replace(/^-ms-/, "ms-").replace(/-([a-z]|[0-9])/ig, function(all, letter){ return (letter+"").toUpperCase(); }); }, cssVendor=(function(){ var ts=testStyle, cases=['-o-','-webkit-','-moz-','-ms-',''],i=0; do { if(camelCase(cases[i]+'transform') in ts){ return cases[i]; } } while(++i50){ if(pageX>0){ slidePrev(e); }else{ slideNext(e); } } clearAnimatea = setTimeout(autoPlay, time); touched=null; }); /* 防止阻止touchend事件 */ touchMain.addEventListener('touchmove',function(e){ if(null==touched){ var pageX = e.changedTouches[0].pageX-page.x; var pageY = e.changedTouches[0].pageY-page.y; touched=Math.abs(pageX-page.x)760){ ele.maxImg.hover(function(){ if(ele.aniMation){ $(this).addClass('aniimgstyle'); }else{ $(this).addClass('imgstyle'); } },function(){ if(ele.aniMation){ $(this).removeClass('aniimgstyle'); }else{ $(this).removeClass('imgstyle'); } }); }else{ return false; } }, windowEvent: function(ele){ if(!IsIOS && !IsAndroid){ if(ele.windowMain.height() < 640){ ele.downlaodMain.removeClass('position'); ele.downlaodMain.addClass('padding'); }else{ ele.downlaodMain.removeClass('padding'); ele.downlaodMain.addClass('position'); } } }, flipObj: function(ele,time){ if(!IsIOS && !IsAndroid){ setTimeout(function(){ if(ele.aniMation){ ele.codeImg.show().addClass('flip'); ele.phoneImg.hide(); }else{ ele.codeImg.show(); ele.phoneImg.hide(); } },time); ele.phoneImg.click(function(){ ele.phoneImg.hide().removeClass('flip'); ele.codeImg.show().addClass('flip'); }); ele.codeImg.click(function(){ ele.codeImg.hide().removeClass('flip'); ele.phoneImg.show().addClass('flip'); }); }else{ $('.pc-download').css({position:'absolute',left:'0',zIndex:'11',top:'156px;'}); $('.phone-download').css({position:'absolute',left:'0',zIndex:'12',top:'-156px'}); } }, staJS: function(){ $(document).on('click','a',function(e){ var statData = $(this).attr('stat'); try { _hmt.push(['_trackEvent',statData, 'webLB', 'click', 'download',statData]); } catch (e) {} }); }, init: function(ele){ liebaoBrowser.banSlide(0,5000,ele,500); liebaoBrowser.domAnimation(ele); liebaoBrowser.windowEvent(ele); liebaoBrowser.maxImgInit(ele); ele.windowMain.on('resize',function(){ liebaoBrowser.windowEvent(ele); liebaoBrowser.maxImgInit(ele); }); liebaoBrowser.flipObj(ele,2000); liebaoBrowser.staJS(); } }; $(function(){ var domEle = { navhover: $('.nav-main a'), detBtn: $('.details'), maxImg: $('.news-img'), fnLi: $('.ft-list li'), aniMation: isCSS('animation'), watchLb: $('#watch-lb'), code: $('.watch-code'), downBtn: $('.beta-info a'), downlaodMain: $('.downlaod-main'), windowMain: $(window), bodyEle: $('body'), stopAnimte: $('.slide,.prev,.next,.item'), prev: $('.prev'), next: $('.next'), slide: $('.slide'), slideCur: $('.item a'), phoneImg: $('.phone-img'), codeImg: $('.code-img') }; domEle.downlaodMain.show(); liebaoBrowser.init(domEle); });