if(navigator.userAgent.indexOf('iPad') != -1){ document.write('\n'); }else if(navigator.userAgent.indexOf('Mobile') != -1){ document.write('\n'); }else if(navigator.userAgent.indexOf('Android') != -1){ document.write('\n'); }else{ document.write('\n'); } new WOW().init() //禁止ios10 自带浏览器放大缩小 window.onload=function () { document.addEventListener('touchstart',function (event) { if(event.touches.length>1){ event.preventDefault(); } }); var lastTouchEnd=0; document.addEventListener('touchend',function (event) { var now=(new Date()).getTime(); if(now-lastTouchEnd<=300){ event.preventDefault(); } lastTouchEnd=now; },false) }; $(window).on('scroll', function() { if ($(document).scrollTop() < 90) { $('.header .header-top').removeClass('header-topbg'); } else { $('.header .header-top').addClass('header-topbg'); } }); $(function(){ $('.header-top .nav').click(function(){ if($(this).hasClass('cur')){ $(this).removeClass('cur'); $('.nav-holder').fadeOut(); $('.nav-holder .nav-list').addClass('nav-load'); } else{ $(this).addClass('cur'); $('.nav-holder').fadeIn(); $('.nav-holder .nav-list').removeClass('nav-load'); } }); }); /*$(function(){ $('.about a').on('click',function() { $('.mask').fadeIn(200); }); $('.photo-mask .close').on('click',function() { $('.mask').fadeOut(200); }); });*/ $(function(){ $('.about a').on('click',function() { $(".mask").css({ "z-index": 1001, "opacity": "1" }); }); $('.mask .close').on('click',function() { $(".mask").css({ "z-index": "-1", "opacity": "0" }); }); }); $(function(){ var swiper = new Swiper('.industry .swiper-container-4', { slidesPerView: 3, spaceBetween: 45, pagination: { el: '.swiper-pagination', clickable: true, }, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, }); }); $(function(){ $(".p-about-1 .down").hover(function(){ $(".p-about-1 .content").animate({ marginTop:-$(".p-about-1 .content").height()+$(".p-about-1 .frame").height()+"px" },5000) },function(){ $(".p-about-1 .content").stop() }) $(".p-about-1 .up").hover(function(){ $(".p-about-1 .content").animate({ marginTop:0 },5000) },function(){ $(".p-about-1 .content").stop() }) }) function animateCounters() { $('.counter:in-viewport').each(function() { var $t = $(this), n = $t.attr("data-value"), r = parseInt($t.attr("data-speed"), 10); if (!$t.hasClass("already-animated")) { $t.addClass("already-animated"); $({ countNum: $t.text() }).animate({ countNum: n }, { duration: r, easing: "linear", step: function() { $t.text(Math.floor(this.countNum)); }, complete: function() { $t.text(this.countNum); } }); } }); } $(document).ready(function() { animateCounters(); }); $(window).scroll(function() { animateCounters(); }); $(document).ready(function(){ $(".wechat").hover(function(){ $(this).find(".wechat-img").fadeIn(200); $('.wechat-img').removeClass('location') },function(){ $(this).find(".wechat-img").fadeOut(200); /* fading out the sub menu */ $('.wechat-img').addClass('location') }); }); $(function(){ $("a[href^='#']").click(function(){ $('html, body').animate({scrollTop: $(this.hash).offset().top-90}, 400); }); $(".p-news li:nth-child(3n),.p-project li:nth-child(3n),.p-newspaper li:nth-child(4n),.p-culture-1 li:nth-child(3n)").css({"margin-right":"0"}); $(".p-contact-2 .map-list li:nth-last-child(1)").css({"border":"none"}); $('#culture-canvas').polygonizr(); /*$(window).load(function(){ $('.load').fadeOut(); })*/ }); /*var ai=0; function add(ai){ var num =$(".load-num"); num.html(ai+" %"); } function xh(){ if(ai>100){ $('.load').fadeOut(); return; } if(ai<=100){ setTimeout("xh()",100) add(ai); ai++; } } $(window).ready(function(){ xh(); });*/