jQuery(document).ready(function() { // jQuery("img").lazyload({ // effect : "fadeIn" // }); new WOW().init(); // header $(window).scroll(function() { if ($(window).scrollTop() > 0) { $(".header").addClass("header-small"); } else { $(".header").removeClass("header-small"); } }); if ($(window).scrollTop() > 0) { $(".header").addClass("header-small"); } else { $(".header").removeClass("header-small"); } $('.head-nav li').hover(function(){ $(this).find('.nav-main').addClass("show").stop(true,true); },function(){ $(this).find('.nav-main').removeClass("show").stop(true,true); }); $('.head-menu').click(function(){ $(this).toggleClass('head-menu-close'); $('.header').toggleClass('head-open'); }); $('.mhead-main .phead-nav .item-links').click(function(){ $(this).siblings('.subnav-box').stop().slideToggle("slow"); $(this).find('.jt').toggleClass("jt-rotate"); }); $(".video-btn").click(function(){ var title=$(this).attr("data-title"); var videourl=$(this).attr("data-url"); layer.open({ type: 1, title: title, area: ['60%', '74%'], shade: 0.8, closeBtn: 1, shadeClose: true, skin: 'video-layer', content: '', maxmin: true, }); }); $(".search").click(function(){ $(".contact-jobform.search-main").fadeIn(); }); $(".index-banner .scroll").click(function() { $('html,body').animate({scrollTop: $('#pro').offset().top}, 500); }); $(".dj-jianli").click(function(){ var title=$(this).attr("data-title"); $(".contact-jobform.job").fadeIn(); $("#jobname").val(title); }); $(".contact-jobform .close").click(function(){ $(this).parent().parent().fadeOut(); }); $(".contact-jobform .mengc").click(function(){ $(this).parent().fadeOut(); }); $(".pro-type .top").click(function() { $(this).find(".jia").toggleClass("on"); $(this).parent().find(".bottom").stop().slideToggle(); }); var vhheight = $(window).height(); $(window).scroll(function() { if ($(window).scrollTop() > 500) { $(".fix-top").addClass("on"); } else { $(".fix-top").removeClass("on"); } }); if ($(window).scrollTop() > 500) { $(".fix-top").addClass("on"); } else { $(".fix-top").removeClass("on"); } $(".fix-top").click(function() { return $("body,html").animate({ scrollTop: 0 }, 500), !1 }); $(".honor-pic li").click(function(){ var title=$(this).attr("data-title"); var picurl=$(this).attr("data-pic"); layer.open({ type: 1, title: title, area: ['40%', '60%'], shade: 0.8, closeBtn: 1, shadeClose: true, skin: 'video-layer', content: '', maxmin: true, }); }); var swiperban = new Swiper('.index-banner .swiper-container', { slidesPerView :1, spaceBetween: 0, speed:800, autoplay: { delay:5000, disableOnInteraction: false, }, loop:true, // effect:'fade', simulateTouch : false, navigation: { nextEl: '.i-page .page-r', prevEl: '.i-page .page-l', }, on:{ init: function() { numList = ''; this.$el.parent().find('.swiper-pagination').html(numList + '/' + '' + 0 + ( (this.slides.length - 2) ) + ''); //paginationRender会每次更新dom,无法产生动画效果,所以使用html()生成pagination this.emit('transitionStart'); $(".index-banner .page .line").addClass("on"); }, transitionStart: function() { realIndex = this.realIndex; speed = this.params.speed; bullets = this.$el.parent().find(' .swiper-pagination li'); sldieLength = bullets.length; for (i = 0; i < sldieLength; i++) { if ((i - realIndex) > Math.floor(sldieLength/2)) { difference = i - sldieLength - realIndex; } else if ((i - realIndex) < -Math.floor(sldieLength/2)) { difference = i + sldieLength - realIndex; } else { difference = i - realIndex; } bullets.eq(i).transition(speed); bullets.eq(i).transform('rotateX(' + difference * 30 + 'deg) translate3d(0, ' + difference * 60 + 'px, 0)') ; bullets.eq(i).css('opacity', 1 - Math.abs(difference)); } $(".index-banner .page .line").removeClass("on"); }, transitionEnd: function(){ $(".index-banner .page .line").addClass("on"); }, }, }); $(".i-page").on('click','.dj-zanting',function(){ $(this).addClass("bofang").removeClass("dj-zanting"); $('.i-page .line .colorline').css('animation-play-state','paused'); $('.index-banner .bimg').css('animation-play-state','paused'); swiperban.autoplay.stop(); }); $(".i-page").on('click','.bofang',function(){ $(this).removeClass("bofang").addClass("dj-zanting"); $('.i-page .line .colorline').css('animation-play-state','running'); $('.index-banner .bimg').css('animation-play-state','running'); swiperban.autoplay.start(); }); var inewsmain = new Swiper('.inews-swipermain.swiper-container',{ speed: 800, slidesPerView: 1, spaceBetween: 10, // effect:'fade', // fadeEffect: { // crossFade: true, // }, simulateTouch : false, autoHeight:true, on: { init: function(){ swiperAnimateCache(this); swiperAnimate(this); }, slideChangeTransitionEnd: function(){ swiperAnimate(this); }, slideChangeTransitionStart: function(){ $('.inews-qh a.on').removeClass('on'); $('.inews-qh a').eq(inewsmain.activeIndex).addClass('on'); }, }, }); $('.inews-qh a').click(function(){ var _ = $(this); _.addClass('on').siblings().removeClass('on'); inewsmain.slideTo(_.index()); return false; }); var inewszi1 = new Swiper('.inews-swiperzi1 .swiper-container',{ speed: 800, slidesPerView: 1, spaceBetween: 10, loop:true, loopedSlides:5, navigation: { nextEl: '.inews-page .next', prevEl: '.inews-page .prev', }, simulateTouch : false, breakpoints: { 600:{ slidesPerView: 2, spaceBetween: 30, }, 1240: { slidesPerView: 3, spaceBetween: 50, }, 1550: { slidesPerView: 3, spaceBetween: 106, }, }, on:{ init: function() { numList = ''; var manum = this.$el.attr("data-num"); this.$el.find('.swiper-pagination1').html(numList + '/' + '' + ( manum ) + ''); //paginationRender会每次更新dom,无法产生动画效果,所以使用html()生成pagination this.emit('transitionStart'); }, transitionStart: function() { realIndex = this.realIndex; speed = this.params.speed; bullets = this.$el.find(' .swiper-pagination1 li'); sldieLength = bullets.length; for (i = 0; i < sldieLength; i++) { if ((i - realIndex) > Math.floor(sldieLength/2)) { difference = i - sldieLength - realIndex; } else if ((i - realIndex) < -Math.floor(sldieLength/2)) { difference = i + sldieLength - realIndex; } else { difference = i - realIndex; } bullets.eq(i).transition(speed); bullets.eq(i).transform('rotateX(' + difference * 30 + 'deg) translate3d(0, ' + difference * 60 + 'px, 0)') ; bullets.eq(i).css('opacity', 1 - Math.abs(difference)); } }, }, }); var inewszi2 = new Swiper('.inews-swiperzi2 .swiper-container',{ speed: 800, slidesPerView: 1, spaceBetween: 10, loop:true, loopedSlides:5, navigation: { nextEl: '.inews-page .next', prevEl: '.inews-page .prev', }, simulateTouch : false, breakpoints: { 600:{ slidesPerView: 2, spaceBetween: 30, }, 1240: { slidesPerView: 3, spaceBetween: 50, }, 1550: { slidesPerView: 3, spaceBetween: 106, }, }, on:{ init: function() { numList = ''; var manum = this.$el.attr("data-num"); this.$el.find('.swiper-pagination2').html(numList + '/' + '' + ( manum ) + ''); //paginationRender会每次更新dom,无法产生动画效果,所以使用html()生成pagination this.emit('transitionStart'); }, transitionStart: function() { realIndex = this.realIndex; speed = this.params.speed; bullets = this.$el.find(' .swiper-pagination2 li'); sldieLength = bullets.length; for (i = 0; i < sldieLength; i++) { if ((i - realIndex) > Math.floor(sldieLength/2)) { difference = i - sldieLength - realIndex; } else if ((i - realIndex) < -Math.floor(sldieLength/2)) { difference = i + sldieLength - realIndex; } else { difference = i - realIndex; } bullets.eq(i).transition(speed); bullets.eq(i).transform('rotateX(' + difference * 30 + 'deg) translate3d(0, ' + difference * 60 + 'px, 0)') ; bullets.eq(i).css('opacity', 1 - Math.abs(difference)); } }, }, }); var inewszi3 = new Swiper('.inews-swiperzi3 .swiper-container',{ speed: 800, slidesPerView: 1, spaceBetween: 10, loop:true, loopedSlides:5, navigation: { nextEl: '.inews-page .next', prevEl: '.inews-page .prev', }, simulateTouch : false, breakpoints: { 600:{ slidesPerView: 2, spaceBetween: 30, }, 1240: { slidesPerView: 3, spaceBetween: 50, }, 1550: { slidesPerView: 3, spaceBetween: 106, }, }, on:{ init: function() { numList = ''; var manum = this.$el.attr("data-num"); this.$el.find('.swiper-pagination3').html(numList + '/' + '' + ( manum ) + ''); //paginationRender会每次更新dom,无法产生动画效果,所以使用html()生成pagination this.emit('transitionStart'); }, transitionStart: function() { realIndex = this.realIndex; speed = this.params.speed; bullets = this.$el.find(' .swiper-pagination3 li'); sldieLength = bullets.length; for (i = 0; i < sldieLength; i++) { if ((i - realIndex) > Math.floor(sldieLength/2)) { difference = i - sldieLength - realIndex; } else if ((i - realIndex) < -Math.floor(sldieLength/2)) { difference = i + sldieLength - realIndex; } else { difference = i - realIndex; } bullets.eq(i).transition(speed); bullets.eq(i).transform('rotateX(' + difference * 30 + 'deg) translate3d(0, ' + difference * 60 + 'px, 0)') ; bullets.eq(i).css('opacity', 1 - Math.abs(difference)); } }, }, }); var aboutevents = new Swiper('.about-events .swiper-container',{ speed: 800, slidesPerView: 1, spaceBetween: 10, loop:true, navigation: { nextEl: '.inews-page .prev', prevEl: '.inews-page .next', }, simulateTouch : false, breakpoints: { 600:{ slidesPerView: 2, spaceBetween: 30, }, 1240: { slidesPerView: 3, spaceBetween: 50, }, 1550: { slidesPerView: 4, spaceBetween: 50, }, }, }); var swipertech1 = new Swiper('.tech-warp1 .swiper-container', { watchSlidesProgress: true, slidesPerView: 1, spaceBetween: 20, speed:800, simulateTouch : false, centeredSlides: true, loop: true, loopedSlides: 5, navigation: { nextEl: '.tech-warp1 .next', prevEl: '.tech-warp1 .prev', }, pagination: { el: '.tech-warp1 .swiper-pagination', clickable :true, }, breakpoints: { 600: { slidesPerView: 2, spaceBetween: 20, }, 940: { slidesPerView: 3, spaceBetween: 30, }, }, // on: { // init: function(){ // swiperAnimateCache(this); // swiperAnimate(this); // }, // slideChangeTransitionEnd: function(){ // swiperAnimate(this); // }, // progress: function(progress) { // for (i = 0; i < this.slides.length; i++) { // var slide = this.slides.eq(i); // var slideProgress = this.slides[i].progress; // modify = 1; // if (Math.abs(slideProgress) > 1) { // modify = (Math.abs(slideProgress) - 1) * 0.3 + 1; // } // translate = slideProgress * modify * 875 + 'px'; // scale = 1 - Math.abs(slideProgress) / 5.8; // zIndex = 999 - Math.abs(Math.round(10 * slideProgress)); // slide.transform('translateX(' + translate + ') scale(' + scale + ')'); // slide.css('zIndex', zIndex); // slide.css('opacity', 1); // if (Math.abs(slideProgress) > 3) { // slide.css('opacity', 0); // } // } // }, // setTransition: function(transition) { // for (var i = 0; i < this.slides.length; i++) { // var slide = this.slides.eq(i) // slide.transition(transition); // } // } // }, }); var swipertech2 = new Swiper('.tech-warp2 .swiper-container', { watchSlidesProgress: true, slidesPerView: 1, simulateTouch : false, loop: true, loopedSlides: 5, speed:800, navigation: { nextEl: '.tech-warp2 .next', prevEl: '.tech-warp2 .prev', }, breakpoints: { 600:{ slidesPerView: 1, spaceBetween: 30, }, 1240: { slidesPerView: 3, spaceBetween: 50, centeredSlides: true, }, 1720: { slidesPerView: 'auto', centeredSlides: true, }, }, on: { init: function(){ swiperAnimateCache(this); swiperAnimate(this); }, slideChangeTransitionEnd: function(){ swiperAnimate(this); }, }, }); var contactway = new Swiper('.contact-way .main .swiper-container',{ speed: 800, slidesPerView: 1, spaceBetween: 106, effect:'fade', fadeEffect: { crossFade: true, }, simulateTouch : false, on: { init: function(){ swiperAnimateCache(this); swiperAnimate(this); }, slideChangeTransitionEnd: function(){ swiperAnimate(this); }, slideChangeTransitionStart: function(){ $('.contact-way .main .le .top li.on').removeClass('on'); $('.contact-way .main .le .top li').eq(contactway.activeIndex).addClass('on'); }, }, }); var contactmap = new Swiper('.contact-way .mapmain .swiper-container',{ speed: 800, slidesPerView: 1, spaceBetween: 106, effect:'fade', fadeEffect: { crossFade: true, }, simulateTouch : false, on: { init: function(){ swiperAnimateCache(this); swiperAnimate(this); }, slideChangeTransitionEnd: function(){ swiperAnimate(this); }, slideChangeTransitionStart: function(){ $('.contact-way .main .le .top li.on').removeClass('on'); $('.contact-way .main .le .top li').eq(contactmap.activeIndex).addClass('on'); }, }, }); $('.contact-way .main .le .top li').hover(function(){ var _ = $(this); _.addClass('on').siblings().removeClass('on'); contactway.slideTo(_.index()); if ($(".li0").hasClass("on")) { $("#map0").addClass("on"); $("#map1").removeClass("on"); }else{ $("#map1").addClass("on"); $("#map0").removeClass("on"); } // contactmap.slideTo(_.index()); return false; }); var pro1 = new Swiper('.picslide .swiper-container', { watchSlidesProgress: true, slidesPerView: 1, simulateTouch : false, centeredSlides: true, loop: true, loopedSlides: 5, speed:800, navigation: { nextEl: '.picslide .next', prevEl: '.picslide .prev', }, on: { init: function(){ swiperAnimateCache(this); swiperAnimate(this); }, slideChangeTransitionEnd: function(){ swiperAnimate(this); }, }, }); var pro2 = new Swiper('.pr-con-main.swiper-container',{ speed: 800, slidesPerView: 1, spaceBetween: 0, effect:'fade', fadeEffect: { crossFade: true, }, autoHeight:true, simulateTouch : false, on: { init: function(){ swiperAnimateCache(this); swiperAnimate(this); }, slideChangeTransitionEnd: function(){ swiperAnimate(this); }, slideChangeTransitionStart: function(){ $('.pr-con-type ul li.on').removeClass('on'); $('.pr-con-type ul li').eq(pro2.activeIndex).addClass('on'); }, }, }); $('.pr-con-type ul li').hover(function(){ var _ = $(this); _.addClass('on').siblings().removeClass('on'); pro2.slideTo(_.index()); return false; }); });