$(window).on('load', function() { //鍏ュ満鍔ㄦ晥 //宸︿晶杩涘叆娓愭樉 var wow01 = new WOW({ boxClass: 'wow01', animateClass: 'fadeInLeft', offset: 100, mobile: true, live: true }); wow01.init(); //鍙充晶杩涘叆娓愭樉 var wow02 = new WOW({ boxClass: 'wow02', animateClass: 'fadeInRight', offset: 100, mobile: true, live: true }); wow02.init(); //鐢变笅鍚戜笂杩涘叆娓愭樉 var wow03 = new WOW({ boxClass: 'wow03', animateClass: 'fadeInUp', offset: 100, mobile: true, live: true }); wow03.init(); //鐢变笂鍚戜笅杩涘叆娓愭樉 var wow04 = new WOW({ boxClass: 'wow04', animateClass: 'fadeInDown', offset: 100, mobile: true, live: true }); wow04.init(); }); $(function(){ if(!placeholderSupport()){ $('[placeholder]').focus(function() { var input = $(this); if (input.val() == input.attr('placeholder')) { input.val(''); input.removeClass('placeholder'); } }).blur(function() { var input = $(this); if (input.val() == '' || input.val() == input.attr('placeholder')) { input.addClass('placeholder'); input.val(input.attr('placeholder')); } }).blur(); }; if(!IsPC()){$('body').addClass('touch_body')} //ie娴忚鍣 if(isIE()){$('html').addClass('isIe');} // 鑾峰彇褰撳墠url var url_location = window.location.pathname; var arr = []; arr = url_location.split('/'); }) function placeholderSupport() { return 'placeholder' in document.createElement('input'); } function scrollT($Dom){ if($Dom.offset()){ if($(window).scrollTop()+$(window).height()>=$Dom.offset().top+200){ return true; } } } function mainBgResize1($img, width, height, W_b, H_b) { var sw = width, sh = width / W_b * H_b if (sh < height) { sh = height; sw = height / H_b * W_b } $img.css({height:sh,width:sw, marginTop: -(sh - height) / 2, marginLeft: -(sw - width) / 2, 'visibility': 'visible' }); } //鍒ゆ柇鏄惁Firefox娴忚鍣 function isFirefox(){ if (navigator.userAgent.indexOf("Firefox") > -1) return true; else return false; } //鍒ゆ柇鏄惁IE娴忚鍣 function isIE() { if (!!window.ActiveXObject || "ActiveXObject" in window) return true; else return false; } function IsPC() { var userAgentInfo = navigator.userAgent; var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"); var flag = true; for (var v = 0; v < Agents.length; v++) { if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = false; break; } } return flag; } //缁戝畾浜嬩欢鐩戝惉 function addEvent(eve,callback){ if (window.attachEvent){ window.attachEvent("on"+eve,callback); }else if(window.addEventListener) { window.addEventListener(eve,callback,false); } } //鍒ゆ柇pad妯睆绔栧睆锛屽埛鏂伴〉闈 /*addEvent('load', function(){ // orientationChange(); window.onorientationchange = orientationChange; });*/ function orientationChange() { switch(window.orientation) { 銆€銆€case 0: //alert("鑲栧儚妯″紡 0,screen-width: " + screen.width + "; screen-height:" + screen.height); window.location.reload(); break; 銆€銆€case -90: //alert("宸︽棆 -90,screen-width: " + screen.width + "; screen-height:" + screen.height); window.location.reload(); break; 銆€銆€case 90: // alert("鍙虫棆 90,screen-width: " + screen.width + "; screen-height:" + screen.height); window.location.reload(); break; 銆€銆€case 180: 銆€銆€//alert("椋庢櫙妯″紡 180,screen-width: " + screen.width + "; screen-height:" + screen.height); window.location.reload(); 銆€銆€break; } }; //鑾峰彇IE娴忚鍣ㄧ増鏈 function getBrowserVersion(){ var hc = $('html').attr('class'); if(hc){ var ieVersion = hc && hc.split(' ')[1]; if(ieVersion){ $('.browserupgrade>strong').text(ieVersion.toUpperCase()); } } } getBrowserVersion(); //榧犳爣寤惰繜鎵ц浜嬩欢鏂规硶 $.fn.hoverDelay = function(options){ var defaults = { hoverDuring: 200, outDuring: 200, hoverEvent: function(){ $.noop(); }, outEvent: function(){ $.noop(); } }; var sets = $.extend(defaults,options || {}); var hoverTimer, outTimer, that = this; return $(this).each(function(){ $(this).on('mouseenter',function(){ clearTimeout(outTimer); hoverTimer = setTimeout(function(){sets.hoverEvent.apply(that)}, sets.hoverDuring); }); $(this).on('mouseleave',function(){ clearTimeout(hoverTimer); outTimer = setTimeout(function(){sets.outEvent.apply(that)}, sets.outDuring); }); }); } //鏃犲浘鍥惧儚 var noimg = '../images/error.jpg'; function imgerror(t) { t.onerror = null; t.src = noimg } $("header").hover(function(){ $(this).addClass("headerhover"); },function(){ $(this).removeClass("headerhover"); });