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,.iteme'), prev: $('.prev'), next: $('.next'), slide: $('.slide'), slidecur: $('.iteme a'), phoneimg: $('.phone-img'), codeimg: $('.code-img') }; domele.downlaodmain.show(); liebaobrowser.init(domele); });