jQuery(document).ready(function () { jQuery("img").lazyload({ effect: "fadeIn" }); objectFitImages("img.ofi"); objectFitImages("img.ofc"); new WOW().init(); //鍒ゆ柇鏄惁涓篿e娴忚鍣ㄨ闂 var ms_ie = false; var ua = window.navigator.userAgent; var old_ie = ua.indexOf('MSIE聽'); var new_ie = ua.indexOf('Trident/'); if ((old_ie > -1) || (new_ie > -1)) { ms_ie = true; //聽alert("IE娴忚鍣?) } if (ms_ie) { $("body").addClass("ie"); } // 鍥剧墖鍑虹幇鏁堟灉 $(window).load(function () { $('.view').each(function () { var elemPos = $(this).offset().top; var scroll = $(window).scrollTop(); var windowHeight = $(window).height(); if (scroll > elemPos - windowHeight + 100) { $(this).addClass('scrollin'); } }); $('.mask').each(function () { var elemPos = $(this).offset().top; var scroll = $(window).scrollTop(); var windowHeight = $(window).height(); if (scroll > elemPos - windowHeight + 100) { $(this).addClass('scrollin2'); } }); }); $(window).scroll(function () { $('.view').each(function () { var elemPos = $(this).offset().top; var scroll = $(window).scrollTop(); var windowHeight = $(window).height(); if (scroll > elemPos - windowHeight + 100) { $(this).addClass('scrollin'); } }); $('.mask').each(function () { var elemPos = $(this).offset().top; var scroll = $(window).scrollTop(); var windowHeight = $(window).height(); if (scroll > elemPos - windowHeight + 100) { $(this).addClass('scrollin2'); } }); }); // 绮掑瓙绯荤粺鐐瑰拰绾跨殑棰滆壊 $('#particles').particleground({ dotColor: '#e7e7e7', lineColor: '#e7e7e7', }); $(".header-lang-btn").click(function () { $(this).toggleClass("on"); $(".header-lang-slide").stop(true).slideToggle(300) }); $(".header-btn").click(function () { var winW = $(window).width(); if (winW > 960) { $(".header-fixed").addClass("on"); $("#fp-nav").addClass("on") $(".section ").css("z-index", "-1"); } if (winW <= 960) { $(".header").toggleClass("on"); $("#fp-nav").toggleClass("on"); // $(".header-mobile").toggleClass("on"); } }); $(".header-fixed-close").click(function () { $(".header-fixed").removeClass("on"); $("#fp-nav").removeClass("on") $(".section ").css("z-index", "auto"); }); $(".nav-main .nav-item").hover(function () { $(".header").addClass("on"); }, function () { $(".header").removeClass("on"); }); // 绉诲姩绔鑸 $(".header-mobile-item .header-mobile-type").click(function () { var i = $(this).parent(".header-mobile-item ").index(); if(i!=0){ $(this).toggleClass("on"); $(this).siblings('.header-mobile-slide').stop().slideToggle(); } }) $(".com-nav-mobile .com-nav-mobile-typename").click(function () { $('.com-nav-mobile-link').stop().slideToggle(); }) // 棣栭〉浜т笟 var product = new Swiper(".i-product-main", { autoplay: { delay: 5000, disableOnInteraction: false, }, effect: 'fade', // loop: true, speed: 800, on: { init: function () { swiperAnimateCache(this); this.emit('slideChangeTransitionStart'); this.emit('slideChangeTransitionEnd'); }, slideChangeTransitionEnd: function () { swiperAnimate(this); }, slideChangeTransitionStart: function () { $('.i-product-menu .on').removeClass('on'); $('.i-product-menu li').eq(this.activeIndex).addClass('on'); $('.i-product-item.swiper-slide-active').addClass('on').siblings().removeClass('on'); } }, }); $('.i-product-menu li').hover(function () { var _ = $(this); _.addClass('on').siblings().removeClass('on'); product.slideTo(_.index()); return false; }); // 棣栭〉鏂囧寲 var culture = new Swiper('.i-culture-content.mobile', { autoplay: { delay: 3000, disableOnInteraction: false, }, speed: 800, observer: true, observeParents: true, observeSlideChildren: true, breakpoints: { 230: { autoplay: { delay: 5000, }, loop: true, slidesPerView: 1, spaceBetween: 0, }, 600: { autoplay: { delay: 5000, }, loop: true, slidesPerView: 2, spaceBetween: 0, } }, pagination: { el: '.i-culture-page.swiper-pagination', clickable: true, } }) // 棣栭〉鏂伴椈 var news = new Swiper(".i-news-latest", { // autoplay: { // delay: 3000, // }, speed: 800, effect: 'fade', loop: true, observer: true, observeParents: true, observeSlideChildren: true, on: { init: function () { swiperAnimateCache(this); //闅愯棌鍔ㄧ敾鍏冪礌 this.emit('slideChangeTransitionStart');//鍦ㄥ垵濮嬪寲鏃惰Е鍙戜竴娆lideChangeTransitionStart浜嬩欢 this.emit('slideChangeTransitionEnd');//鍦ㄥ垵濮嬪寲鏃惰Е鍙戜竴娆lideChangeTransitionStart浜嬩欢 }, slideChangeTransitionStart: function () { var i = parseInt(this.realIndex); $('.i-news-latest .swiper-slide.swiper-slide-active').addClass('on').siblings().removeClass('on'); $(".i-news-item").eq(i).addClass('on').siblings().removeClass('on'); }, slideChangeTransitionEnd: function () { swiperAnimate(this); //姣忎釜slide鍒囨崲缁撴潫鏃惰繍琛屽綋鍓峴lide鍔ㄧ敾 // this.slides.eq(this.activeIndex).find('.ani').removeClass('ani');//鍔ㄧ敾鍙睍绀轰竴娆 }, }, }); $('.i-news-item').hover(function () { var _ = $(this); _.addClass('on').siblings().removeClass('on'); news.slideToLoop(_.index()); return false; }); // 杩斿洖椤堕儴 $(".totop").click(function () { $("html,body").animate({ scrollTop: '0px' }, 500); }) // 鍏充簬鎴戜滑 var leader = new Swiper('.about-leader-main', { autoplay: { delay: 3000, }, speed: 800, slidesPerView: 'auto', slidesPerGroup: 3, pagination: { el: '.about-leader-main .swiper-pagination', clickable: true, }, navigation: { nextEl: '.about-leader-show .about-next', prevEl: '.about-leader-show .about-prev', }, breakpoints: { 230: { slidesPerGroup: 1, }, 600: { slidesPerGroup: 2, }, 960: { slidesPerGroup: 3, } }, }); var vision = new Swiper('.culture-vision', { speed: 800, slidesPerView: 'auto', breakpoints: { 230: { slidesPerGroup: 1, allowTouchMove: true, // loop: true, }, 1000: { allowTouchMove: false // slidesPerGroup: 3, } }, }); var hope = new Swiper('.culture-hope', { speed: 800, slidesPerView: 1, effect : 'fade', loop:true, }); $('.hope-menu-item').hover(function () { var _ = $(this); // _.addClass('on').siblings().removeClass('on'); hope.slideToLoop(_.index()); return false; }); var mind = new Swiper('.mind-pic', { autoplay: { delay: 3000, }, speed: 800, slidesPerView: 'auto', slidesPerGroup: 3, pagination: { el: '.mind-pic .swiper-pagination', clickable: true, }, navigation: { nextEl: '.about-next', prevEl: '.about-prev', }, breakpoints: { 230: { slidesPerGroup: 1, }, 500: { slidesPerGroup: 2, }, 768: { slidesPerGroup: 3, } }, }); var meeting = new Swiper('.about-meeting-part', { autoplay: { delay: 3000, }, speed: 800, slidesPerView: 'auto', slidesPerGroup: 4, pagination: { el: '.about-meeting-part .swiper-pagination', clickable: true, }, navigation: { nextEl: '.about-next', prevEl: '.about-prev', }, breakpoints: { 230: { slidesPerGroup: 1, }, 400: { slidesPerGroup: 2, }, 768: { slidesPerGroup: 4, } }, }); // $(".honor-item").click(function(){ // var url = $(this).find(".honor-pic-item").attr('src'); // var name = $(this).find(".honor-title").text(); // $(".pic-fixed-main img").attr('src',url); // $(".pic-fixed-name p").text(name); // $(".pic-fixed").show(); // }) // $(".pic-fixed-close").click(function(){ // $(".pic-fixed").hide(); // }) // 浜т笟甯冨眬 var equipment = new Swiper('.equipment-swiper', { speed: 800, slidesPerView: 'auto', slidesPerGroup: 1, navigation: { nextEl: '.equipment-right', prevEl: '.equipment-left', }, pagination: { el: '.equipment-swiper .swiper-pagination', clickable: true, }, // breakpoints: { // 230: { // slidesPerGroup: 1, // }, // 768: { // slidesPerGroup: 2, // } // }, }); var equipmentitem = $(".equipment-item"); var arr = []; for (var i = 0; i < $(equipmentitem).length; i++) { var num = $(equipmentitem).eq(i).attr("data-num"); if ($.inArray(num, arr) == -1) { arr.push(num); } } var l = parseInt(arr.length) if (l == 1) { equipment.allowTouchMove = false; equipment.loop = false; $(".equipment-left").css("pointer-events", "none"); $(".equipment-right").css("pointer-events", "none"); } // 绀句細鎷涜仒 $(".society-item-type").click(function () { $(this).toggleClass("on") var parent = $(this).parent(); var item = $(parent).find(".society-info"); $(item).slideToggle(); }) $(".recruitment-btn").click(function () { $(".join-fixed").show(); }) $(".join-close").click(function () { $(".join-fixed").hide(); $(".join-form-input").val(""); $("#ffcontent").val(""); $(".join-input-files").val(""); }) });