//搜索按钮 function goSearch(url) { window.location.href = url; } $(function(){ aself(); if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))) { new WOW().init(); } if($(window).width()<=960){ $(".search-wrap").prependTo("nav"); $(".header-top").prependTo("nav"); } $(document).on("click",".search-wrap",function(e){ e.stopPropagation(); if($(this).hasClass("on")){ $(this).removeClass("on"); }else{ $(this).addClass("on"); } }) $(document).on("click",".search-inner",function(e){ e.stopPropagation(); }) $(document).click(function(){ $(".search-wrap").removeClass("on"); }) $(".in_menu").click(function(){ if($("body").hasClass("openPhone")){ $("body").removeClass("openPhone"); $(".nav_phone_btn").removeClass("visible_nav"); $(".header-bottom nav li dl").removeClass("on"); }else{ $("body").addClass("openPhone"); $(".nav_phone_btn").addClass("visible_nav"); } }) if($(".in_menu").is(":visible")) { $(".header-right").height($(window).innerHeight()-$(".header").innerHeight()); $(".header-bottom nav li").each(function(i){ if($(this).find("dl").size()!=0){ $(this).children("a").attr("href","javascript:void(0)"); $(this).children("a").click(function(){ $(this).next().addClass("on"); }) } $(this).find("dl dd:eq(0)").click(function(){ $(this).parent().removeClass("on"); }) }) } /* addNumber($(".in-about-bottom span:eq(0) i"),32,60); addNumber($(".in-about-bottom span:eq(1) i"),600,10); addNumber($(".in-about-bottom span:eq(2) i"),20,80); */ try{ numbeat($(".in-about-bottom"),$(".in-about-bottom span:eq(0) i")); numbeat($(".in-about-bottom"),$(".in-about-bottom span:eq(1) i")) numbeat($(".in-about-bottom"),$(".in-about-bottom span:eq(2) i")) }catch(e){ //TODO handle the exception } if(!placeholderSupport()){ // 判断浏览器是否支持 placeholder $('[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(); }; psd(); navscroll(); $(window).scroll(function(){ navscroll(); }); $(".weixin").click(function(){ $(".download_zz_box,.download_zz").fadeIn(); }) $(".download_zz_box").click(function(){ $(".download_zz_box,.download_zz").hide(); }) //var validCode = true; //$(document).on("click",".btn_yzm",function(){ // var time = 60; // var code = $(this); // if (validCode) { // code.addClass("disabled"); // validCode = false; // var t = setInterval(function () { // time--; // console.log(time) // code.html(time + "秒"); // if (time == 0) { // clearInterval(t); // code.html("重新获取"); // validCode = true; // code.removeClass("disabled"); // } // }, 1000) // } //}) /* var i=1; $("#lcl_contents_wrap").on("mousewheel",function(event, delta){ var dir = delta > 0 ? 'Up' : 'Down'; if (dir == 'Up') { i=i+0.2 $(this).css("transform",'scale3d('+i+','+i+','+i+')'); console.log(11) } else { if(i<=1){ $(this).css("transform",'scale3d(1,1,1)') }else{ i=i-0.2; $(this).css("transform",'scale3d('+i+','+i+','+i+')') } } return false; }); */ }) function aself(){ if($(window).width()<=1024){ $("a").each(function(){ $(this).attr("target","_self") }) } } function navscroll(){ if($(window).scrollTop()>0){ $("body").addClass("scroll"); }else{ $("body").removeClass("scroll"); } } function placeholderSupport() { return 'placeholder' in document.createElement('input'); } function addNumber(target,num,speed){ var timer=null; var count=0; timer=setInterval(function(){ if(count >= num){ count=num; $(target).text(count); }else{ count+=3; $(target).text(count); } },speed); } function numbeat(wraper,target){ //保证数字跳动只执行一次 var flag = true; var spacenum = 1; var arr = 0; var max = parseFloat(target.attr("rel")); //保证数据结束的统一性 if(max>20){ spacenum = parseInt(max/20); } if($(window).scrollTop() > wraper.offset().top-$(window).height()/1.2){ flag = false; var timer = setInterval(function() { arr = arr + spacenum; arr < max ? arr : clearInterval(timer); if(arr>=max){ target.html(max); }else{ target.html(arr); } }, 100); } $(window).scroll(function(){ if(flag){ if($(window).scrollTop() > wraper.offset().top-$(window).height()/1.2){ flag = false; var timer = setInterval(function() { arr = arr + spacenum; arr < max ? arr : clearInterval(timer); if(arr>=max){ target.html(max); }else{ target.html(arr); } }, 100); } } }) } function psd(){ if($("html").hasClass("lt10")){ $("input[type=password]").each(function(){ // console.log($(this).val()); $(this).attr("type","text") var _val = $(this).attr("placeholder"); // $(this).val(_val); // $(this).removeAttr("placeholder"); $(this).focus(function(){ $(this).attr("type","password"); }); $(this).blur(function(){ if($(this).val() == _val){ $(this).attr("type","text") return; }else{ } }); }); } }