//_load (function($,w){ var winhei=$(w).height(); var loadfn=function(){ var $conlis=$('[_load]'); $conlis.each(function(i,v){ var scrolltop=$(w).scrolltop(); var $v=$(v); if($conlis.filter('_load')==0) $(w).off('scroll.z'); if( winhei+scrolltop > $v.offset().top){ $v.addclass('active'); $(this).removeattr('_load'); } }) }; $(w).on('scroll.z load',loadfn); })(jquery, window); //requestanimationframe (function() { var lasttime = 0; var vendors = ['webkit', 'moz']; for(var x = 0; x < vendors.length && !window.requestanimationframe; ++x) { window.requestanimationframe = window[vendors[x] + 'requestanimationframe']; window.cancelanimationframe = window[vendors[x] + 'cancelanimationframe'] || // name has changed in webkit window[vendors[x] + 'cancelrequestanimationframe']; } if (!window.requestanimationframe) { window.requestanimationframe = function(callback, element) { var currtime = new date().gettime(); var timetocall = math.max(0, 16.7 - (currtime - lasttime)); var id = window.settimeout(function() { callback(currtime + timetocall); }, timetocall); lasttime = currtime + timetocall; return id; }; } if (!window.cancelanimationframe) { window.cancelanimationframe = function(id) { cleartimeout(id); }; } })(); $(function () { var wow = new wow({ boxclass: 'wow', animateclass: 'animated', offset: 0, live: true }); if (!(/msie [6|7|8|9]/i.test(navigator.useragent))) { wow.init(); }; // function isie() { // if (!!window.activexobject || "activexobject" in window) { // $('body').attr('id','ie'); // return true; // } else { // return false; // } // } // // isie(); var width=$(window).width(); $('.header .search').click(function () { $('.header .search-list').fadein(); }); $(document).mouseup(function (e) { var con = $('.header .search-box'); // 设置目标区域 if (!con.is(e.target) && con.has(e.target).length === 0 ) { $('.header .search-list').fadeout(); } }); $('.search-btns').click(function(){ var str = $('.search-center input').val(); if(str){ window.open('/search.html?keywords=' + str+'&appids=all', '_self'); } }); $(document).on('keydown', function(ev) { if (ev.keycode == 13) { var str = $('.search-center input').val(); if (str) { window.open('/search.html?keywords=' + str + '&appids=all', '_self'); } } }); if(width>1024){ $('.scroll-2').mcustomscrollbar(); $('.header .nav-list .bottom .left ul li:first-child').addclass('active'); $('.header .nav-list .bottom .middle .m-box:first-child').addclass('active'); $('.header .nav-list .bottom .middle .m-box:first-child ul li:first-child').addclass('active'); $('.header .nav-list .bottom .right .r-box:first-child').addclass('active'); $('.header .nav-list .bottom .right .r-box:first-child ul li:first-child').addclass('active'); var i_num=0; $('.header .nav-list .bottom .left ul li').mouseenter(function () { i_num=$(this).index(); $(this).addclass('active').siblings().removeclass('active'); $('.header .nav-list .bottom .middle .m-box').eq(i_num).addclass('active').siblings().removeclass('active'); }); $('.header .nav-list .bottom .middle .m-box ul li').mouseenter(function () { var index=$(this).index(); $('.header .nav-list .bottom .middle .m-box ul li').removeclass('active'); $(this).addclass('active').siblings().removeclass('active'); $('.header .nav-list .bottom .right .r-box').eq(i_num).addclass('active').siblings().removeclass('active'); $('.header .nav-list .bottom .right .r-box').eq(i_num).find('ul li').eq(index).addclass('active').siblings().removeclass('active'); }); $('.header .con .nav > ul > li').each(function(index){ $(this).hoverdelay({ hoverduring: 50, outduring: 0, hoverevent:function(){ if(index == 1){ $('.header .con .nav > ul > li:nth-child(2) h2').addclass('active'); }else{ $('.header .con .nav > ul > li:nth-child(2) h2').removeclass('active'); } $('.header .con .nav > ul > li').find('.nav-box,.nav-list').removeclass('active'); $(this).find('.nav-box,.nav-list').addclass('active'); }, outevent:function () { $(this).find('.nav-box,.nav-list').removeclass('active'); $('.header .con .nav > ul > li:nth-child(2) h2').removeclass('active'); } }); }); }else{ $('.header').addclass('active'); $('.header .con .nav > ul > li').click(function () { $(this).find('ul').slidetoggle(); $(this).siblings().find('ul').slideup(); $(this).toggleclass('active'); $(this).siblings().removeclass('active'); }); $('.header .nav-button').click(function () { if($(this).hasclass('active')){ $(this).removeclass('active'); $('.header .con .nav').slideup(); $('.header .con .nav> ul > li ul').slideup(); $('.header .con .nav> ul > li').removeclass('active'); }else{ $(this).addclass('active'); $('.header .con .nav').slidedown(); } }); } });