jQuery(document).ready(function() { // jQuery("img").lazyload({ // effect : "fadeIn" // }); if (typeof String.prototype.startsWith !== 'function') { String.prototype.startsWith = function(prefix) { return this.slice(0, prefix.length) === prefix; }; } //endsWith if (typeof String.prototype.endsWith !== 'function') { String.prototype.endsWith = function(suffix) { return this.indexOf(suffix, this.length - suffix.length) !== -1; }; } new WOW().init(); // var phonehtml1 = $(".phonenavm1").html(); // $(".phonenav1").html(phonehtml1); $('#menu').menu(); // header $(window).scroll(function() { if ($(window).scrollTop() > 0) { $(".header").addClass("show"); } else { $(".header").removeClass("show"); } }); if ($(window).scrollTop() > 0) { $(".header").addClass("show"); } else { $(".header").removeClass("show"); } $('.headnav .navmn').hover(function(){ $(this).find('.nav-main').addClass("show").stop(true,true); },function(){ $(this).find('.nav-main').removeClass("show").stop(true,true); }); var navhtml = $(".navdown.oth").html(); $('.headnav .navmn1 .navtitt1 .mcont').html(navhtml); $('.headnav .navmn1 .navtitt1').hover(function(){ $(".navdown").addClass("show").stop(true,true); },function(){ $(".navdown").removeClass("show").stop(true,true); }); $(".navdown").hover(function(){ $(this).addClass("show"); $(".header").addClass("show"); },function(){ $(this).removeClass("show"); }); $(".phone-nav").click(function(){ $(this).toggleClass( "active" ); $(".header").toggleClass( "show" ); if ($(this).hasClass('active')) { $(".phone-nav-mn").addClass("on"); } else { $(".phone-nav-mn").removeClass("on"); } }); $(".header .dj-search").click(function(){ $(this).removeClass("on"); $(this).parent().find(".dj-searchclose").addClass("on"); $(this).parent().addClass("show"); }); $(".header .dj-searchclose").click(function(){ $(this).removeClass("on"); $(this).parent().find(".dj-search").addClass("on"); $(this).parent().removeClass("show"); }); $(".dj-video").click(function(){ var videofile = $(this).attr("data-url"); $(".videotc").addClass("show") $(".videotc .videosrc").attr("src",videofile); }); $(".videotc .mengc").click(function(){ $(".videotc").removeClass("show"); $(".videotc .videosrc").attr("src",""); }); $(".videotc .videoclose").click(function(){ $(".videotc").removeClass("show"); $(".videotc .videosrc").attr("src",""); }); $(".dj-form").click(function(){ $(".contact-jobform").fadeIn(); }); $(".contact-jobform .close").click(function(){ $(".contact-jobform").fadeOut(); }); if ($(window).scrollTop() > 200) { $(".djtop").fadeIn(); } else { $(".djtop").fadeOut(); } $(window).scroll(function() { if ($(window).scrollTop() > 200) { $(".djtop").fadeIn(); } else { $(".djtop").fadeOut(); } }); $(".djtop").click(function(){ return $("body,html").animate({ scrollTop: 0 }, 500), !1 }); var inbanner = new Swiper('.inbanner .swiper ', { slidesPerView :1, effect:"fade", fadeEffect: { crossFade: true, }, loop:true, speed:800, autoplay: { delay:5000, disableOnInteraction: false, }, observer:true, observeParents:true, navigation: { nextEl: '.inbannerqh .nextbox', }, on:{ init: function(){ swiperAnimateCache(this); swiperAnimate(this); }, slideChangeTransitionEnd: function(){ swiperAnimate(this); }, slideChangeTransitionStart: function(){ var number = parseInt($(".inbanner .swiper-slide-active").attr("data-num")); $('.inbannerqh .circlemain .on').removeClass('on'); $('.inbannerqh .circlemain .circle').eq(number).addClass('on'); $(".inbannerqh .nextbox").removeClass("on"); var num = number + 1; $(".inbannerqh .nextbox .num span").text(num) }, transitionEnd: function(){ $(".inbannerqh .nextbox").addClass("on"); }, }, }); $('.inbannerqh .circlemain .circle').hover(function(){ console.log($(this).index()) var bannernum = $(this).attr("data-num"); $(this).addClass('on').siblings().removeClass('on'); inbanner.slideTo(bannernum); return false; }); var incase = new Swiper('.incase.swiper ', { slidesPerView :'auto', speed:800, observer:true, observeParents:true, freeMode: { sticky: true, }, }); var businarea = new Swiper('.businarea .swiper-container ', { slidesPerView :1, effect:"fade", fadeEffect: { crossFade: true, }, speed:800, observer:true, observeParents:true, loop:true, navigation: { nextEl: '.businarea .next', }, autoHeight:true, pagination: { el: '.businarea .swiper-pagination', clickable :true, }, on:{ init: function(){ swiperAnimateCache(this); swiperAnimate(this); }, slideChangeTransitionEnd: function(){ swiperAnimate(this); }, slideChangeTransitionStart: function(){ var number = parseInt($(".businarea .swiper-slide-active").attr("data-num")); $(".businarea .nextbox").removeClass("on"); var num = number + 1; $(".businarea .nextbox .num span").text(num) }, transitionEnd: function(){ $(".businarea .nextbox").addClass("on"); }, }, }); var businstrength = new Swiper('.busin-strength .swiper ', { slidesPerView :1, spaceBetween : 10, speed:800, observer:true, observeParents:true, noSwiping: true, noSwipingClass: 'stop-swiping', navigation: { prevEl: '.busin-strength .prev', nextEl: '.busin-strength .next', }, breakpoints: { 768:{ slidesPerView :3, spaceBetween : 30, }, }, on:{ init: function() { numList = ''; this.$el.parent().parent().find(' .number').html(numList + '/' + '' + 0 + ( (this.slides.length - 2) ) + ''); //paginationRender会每次更新dom,无法产生动画效果,所以使用html()生成pagination this.emit('transitionStart'); $(".busin-strength .pagecon .line").addClass("on"); }, transitionStart: function() { realIndex = this.realIndex; speed = this.params.speed; bullets = this.$el.parent().parent().find(' .number 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)); } $(".busin-strength .pagecon .line").removeClass("on"); }, transitionEnd: function(){ $(".busin-strength .pagecon .line").addClass("on"); }, }, }); var businadvan = new Swiper('.busin-advan .swiper ', { slidesPerView :1, spaceBetween : 20, speed:800, observer:true, observeParents:true, slideToClickedSlide: true, centeredSlides : true, centeredSlidesBounds: true, pagination: { el: '.busin-advan .swiper-pagination', clickable :true, }, breakpoints: { 768:{ slidesPerView :'auto', spaceBetween : 0, }, }, }); var businadvancase = new Swiper('.busin-case .swiper', { slidesPerView :1, spaceBetween : 20, // effect:"fade", // fadeEffect: { // crossFade: true, // }, autoHeight:true, speed:800, observer:true, observeParents:true, on: { init: function(){ swiperAnimateCache(this); swiperAnimate(this); }, slideChangeTransitionEnd: function(){ swiperAnimate(this); }, slideChangeTransitionStart: function(){ $('.busin-case .pagecon .contr .on').removeClass('on'); $('.busin-case .pagecon .contr .mn').eq(businadvancase.activeIndex).addClass('on'); }, }, }); $('.busin-case .pagecon .contr .mn').hover(function(){ var _ = $(this); _.addClass('on').siblings().removeClass('on'); businadvancase.slideTo(_.index()); return false; }); var futurestrength = new Swiper('.future-strength .swiperz', { slidesPerView :1, effect:"fade", fadeEffect: { crossFade: true, }, noSwiping: true, noSwipingClass: 'stop-swiping', speed:800, on: { slideChangeTransitionStart: function(){ $('.future-strength .contr .on').removeClass('on'); $('.future-strength .contr .mn').eq(futurestrength.activeIndex).addClass('on'); }, }, }); $('.future-strength .contr .mn').hover(function(){ var _ = $(this); _.addClass('on').siblings().removeClass('on'); futurestrength.slideTo(_.index()); return false; }); var futurestrength1 = new Swiper('.future-strength .swiper1',{ slidesPerView: 2, grid: { fill: 'column', rows: 2, }, breakpoints: { 768:{ slidesPerView: 3, }, }, speed:800, rewind:true, navigation: { nextEl: '.future-strength .next', }, }) var futurestrength2 = new Swiper('.future-strength .swiper2',{ slidesPerView: 2, grid: { fill: 'column', rows: 2, }, speed:800, breakpoints: { 768:{ slidesPerView: 3, }, }, rewind:true, navigation: { nextEl: '.future-strength .next', }, }) var redswiper = new Swiper('.red-warp3 .swiper', { slidesPerView :1, effect:"fade", fadeEffect: { crossFade: true, }, speed:800, on: { slideChangeTransitionStart: function(){ $('.red-warp3 .contr .on').removeClass('on'); $('.red-warp3 .contr .mn').eq(redswiper.activeIndex).addClass('on'); }, }, }); $('.red-warp3 .contr .mn').hover(function(){ var _ = $(this); _.addClass('on').siblings().removeClass('on'); redswiper.slideTo(_.index()); return false; }); var videoswiper = new Swiper('.video-warp1 .swiper', { slidesPerView :1, spaceBetween:10, speed:800, rewind:true, navigation: { nextEl: '.video-warp1 .next', }, breakpoints: { 768:{ slidesPerView :2, spaceBetween:10, }, 940:{ slidesPerView :3, spaceBetween:20, }, 1240:{ slidesPerView :2, spaceBetween:40, }, }, }); var videoswiper2 = new Swiper('.video-warp2 .swiper',{ slidesPerView: 1, spaceBetween:20, grid: { fill: 'column', rows: 2, }, speed:800, rewind:true, navigation: { prevEl: '.video-warp2 .prev', nextEl: '.video-warp2 .next', }, breakpoints: { 500:{ slidesPerView :2, spaceBetween:20, }, 940:{ slidesPerView :3, spaceBetween:40, }, }, }) var redwarp2 = new Swiper('.red-warp2 .swiper',{ slidesPerView :1, effect:"fade", fadeEffect: { crossFade: true, }, speed:800, mousewheel: { releaseOnEdges: true, }, pagination: { el: '.red-warp2 .swiper-pagination', clickable :true, }, }) var recrudeve2 = new Swiper('.recru-deve2 .swiper2',{ slidesPerView :1, effect:"fade", fadeEffect: { crossFade: true, }, speed:800, autoHeight:true, on: { slideChangeTransitionStart: function(){ $('.recru-deve2 .contr .on').removeClass('on'); $('.recru-deve2 .contr .mn').eq(recrudeve2.activeIndex).addClass('on'); }, }, }); $('.recru-deve2 .contr .mn').hover(function(){ var _ = $(this); _.addClass('on').siblings().removeClass('on'); recrudeve2.slideTo(_.index()); return false; }); var culwarp4swiper = new Swiper('.cul-warp4 .swiper ', { slidesPerView :1, spaceBetween : 20, speed:800, observer:true, observeParents:true, slideToClickedSlide: true, navigation: { nextEl: '.cul-warp4 .next', prevEl: '.cul-warp4 .prev', }, breakpoints: { 300:{ slidesPerView :'auto', spaceBetween : 0, }, }, }); var aboutswiper = new Swiper('.about-pro .swiper ', { slidesPerView :1, spaceBetween : 10, slidesPerGroup : 1, speed:3000, observer:true, observeParents:true, slideToClickedSlide: true, roundLengths: true, navigation: { nextEl: '.about-pro .next', prevEl: '.about-pro .prev', }, loop:true, // freeMode: { // momentum: false, // }, autoplay: { delay:0, disableOnInteraction: false, pauseOnMouseEnter: true, }, breakpoints: { 600:{ slidesPerView :2, spaceBetween : 20, }, 940:{ slidesPerView :3, spaceBetween : 20, }, 1240:{ slidesPerView :4, spaceBetween : 20, }, }, }); aboutswiper.el.onmouseover = function(){ aboutswiper.autoplay.stop(); } aboutswiper.el.onmouseout = function(){ aboutswiper.autoplay.start(); } });