$(function(){ $("header .tool .lang").hover(function() { $("header .tool .lang ul").stop(false, true); $(this).find("ul").slideDown(); }, function() { $("header .tool .lang ul").stop(false, true); $(this).find("ul").slideUp(); }); $("header .tool .search").hover(function() { $(this).find("input").animate({ width: "100px" }).css("marginRight", "5px"); }); $(".nav ul li").hover(function() { $(".nav ul li .dropdown").stop(false, true); $(this).find("a.sub").addClass("active"); $(this).find(".dropdown").show(); }, function() { $(".nav ul li .dropdown").stop(false, true); $(".nav ul li a.sub").removeClass("active"); $(this).find(".dropdown").hide(); }); var wow = new WOW({ boxClass: 'wow', animateClass: 'animated', mobile: true, live: true }); wow.init(); }); function fBrowserRedirect() { var sUserAgent = navigator.userAgent.toLowerCase(); var bIsIpad = sUserAgent.match(/ipad/i) == "ipad"; var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os"; var bIsMidp = sUserAgent.match(/midp/i) == "midp"; var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4"; var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb"; var bIsAndroid = sUserAgent.match(/android/i) == "android"; var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce"; var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile"; if(bIsIpad){ } if(bIsIphoneOs || bIsAndroid){ $(document).bind( "scroll" , function (){ var _st = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; if (_st > 1) { $("header").addClass("fixed"); } else{ $("header").removeClass("fixed"); } }); window.onload = function () { var pos = $('header').offset(); $(window).scroll(function () { //滚动条滚动事件 if ($(this).scrollTop() > 1 ) { $('header').addClass("fixed"); } else if ($(this).scrollTop() <= 1 ) { $('header').removeClass("fixed"); } }) }; } } fBrowserRedirect();