AOS.init({ easing: 'ease-out-back', duration: 1800, placement: 'top-center', once: true }); $(function(){ window.onload = function(){ } $('html head').append('') if($('.pageban .textbox')[0]){ $('.pageban .textbox').addClass('cur'); } $('.headtop .line, .logo').addClass('cur'); //鍝嶅簲寮忔墽琛宩s var windw = $(window).width(); if(windw < 1024){ banner('.m-bann'); $('.headnavitem .name').click(function(){ $(this).toggleClass('cur'); $(this).siblings('.navchilditems').slideToggle(500) $(this).closest('.headnavitem').siblings().find('.navchilditems').slideUp(500) $(this).closest('.headnavitem').siblings().find('.name').removeClass('cur'); }) $('.footfriend .top').click(function(){ console.log(506) $(this).closest('.footfriend').toggleClass('cur') }) //瀛愰〉闈㈠瓙绾у鑸睍寮€浜嬩欢 $('[pagenavclick]').on('click',function(){ if($(this).siblings('[showbox]').length == 1) $(this).toggleClass('cur').siblings('[showbox]').slideToggle(200); }) $('.wapbtnbox').click(function(){ $(this).toggleClass('cur'); $('.navleft').toggleClass('cur'); $('.head').toggleClass('cur') }) $('.navitemname').click(function(){ $(this).toggleClass('cur').siblings('.navchild').slideToggle(400); $(this).closest('.navitem').siblings().find('.navitemname').removeClass('cur').siblings('.navchild').slideUp(400) }) $('.searchbtn').click(function(){ $('.head').addClass('active'); }) $('.searchbox .close').click(function(){ $('.head').removeClass('active'); }) $('.navchilditem .name').click(function(){ $(this).toggleClass('cur'); $(this).siblings('.gadson').slideToggle(400); $(this).closest('.navchilditem').siblings().find('.name').removeClass('cur').siblings('.gadson').slideUp(400) }) $('.foottopwap').click(function(){ $('html, body').animate({scrollTop: '0'}, 1000) }) $('.footmapname').click(function(){ $(this).toggleClass('cur'); $(this).siblings('.footmapchild').slideToggle(500); $(this).closest('.footmaplist').siblings().find('.footmapname').removeClass('cur').siblings('.footmapchild').slideUp(500); }) $('.casevideobot .swiper-slide').click(function(){ var i = $(this).index(); $(this).addClass('cur').siblings().removeClass('cur'); cvswiper1.slideTo(i, 1000, false); }) $('.sales2slidebox .swiper-slide').click(function(){ var i = $(this).index(), l = $('.sales2slidebox .swiper-slide').length; if(i != l-1 || i != l-2 || i != l-3){ salswiper.slideTo(i, 2000, false); $('.sales2item').eq(i).addClass('cur').siblings().removeClass('cur') } }) $('.indexcsmall .swiper-slide .img').on('click', function(){ var i = $(this).closest('.swiper-slide').attr('data-swiper-slide-index'); // $(this).closest('.swiper-slide').addClass('cur').siblings().removeClass('cur'); icswiper.slideTo(i, 1000, false); }) }else{ // function detectZoom (){ // var ratio = 0, // screen = window.screen, // ua = navigator.userAgent.toLowerCase(); // if (window.devicePixelRatio !== undefined) { // ratio = window.devicePixelRatio // }else if (~ua.indexOf('msie')) { // if (screen.deviceXDPI && screen.logicalXDPI) ratio = screen.deviceXDPI / screen.logicalXDPI; // }else if (window.outerWidth !== undefined && window.innerWidth !== undefined) { // ratio = window.outerWidth / window.innerWidth; // } // if(ratio) ratio = Math.round(ratio * 100); // return ratio; // }; // isScale(); // $(window).on('resize',function(){ isScale() }); //鍒ゆ柇PC绔祻瑙堝櫒缂╂斁姣斾緥涓嶆槸100%鏃剁殑鎯呭喌 // function isScale(){ // var rate = detectZoom(); // if(rate != 100) alert('褰撳墠椤甸潰涓嶆槸鏍囧噯100%鏄剧ず锛屼负闃叉娴忚鍣ㄥ嚭閿欙紝璇锋寜閿洏ctrl+0鎭㈠100%鏄剧ず鏍囧噯锛?); // } banner('.pcbanner'); $('#scrolltop').click(function(){ $('html, body').animate({scrollTop: '0'}, 1000) }) $(window).scroll(function(){ var t = $(this).scrollTop(), vh = $(window).height(); if($('.pagehead')[0]){ if(t >= $('[allbanner]').height() - 350) $('.pagehead').addClass('active'); else $('.pagehead').removeClass('active'); } $('.culture2').addClass('cur'); if($('.ndbot')[0]){ var bt = $('.ndbot').offset().top - 110, boxt = bt + $('.ndbot').height() - $('.ndbotleft').height() - 96; if(t > bt && t < boxt){ $('.ndbot').addClass('cur'); $('.ndbot').removeClass('cur2'); }else if(t >= boxt){ $('.ndbot').addClass('cur2').removeClass('cur'); }else{ $('.ndbot').removeClass('cur'); $('.ndbot').removeClass('cur2'); } } }) $('.navitem').hover(function(){ $('.head').stop().toggleClass('cur') }) var caset = setInterval(function(){ var a = "" $('.casetop .img').each(function(){ a = $(this).find('img')[0].complete; }) if(a == true){ clearInterval(caset); $('.casetop .textbox').css({ 'height': $('.casetop .img').eq(0).height() }) } }, 300) setTimeout(function(){ var ndlh = $('.newsdetail .leftbox').height() - 72, ndrh = $('.ndrecbox').height(); if(ndlh > ndrh){ $('.ndrecbox').animate({"height": ndlh},1000); }else{ $('.ndrecbox').addClass('cur') } },1000) $('.casevideobot .swiper-slide').hover(function(){ var i = $(this).index(); $(this).addClass('cur').siblings().removeClass('cur'); cvswiper1.slideTo(i, 1000, false); }) $('.sales2slidebox .swiper-slide .name').click(function(){ var i = $(this).closest('.swiper-slide').index(), l = $('.sales2slidebox .swiper-slide').length; if(i != l-1 || i != l-2 || i != l-3){ salswiper.slideTo(i, 2000, false); $('.sales2item').eq(i).addClass('cur').siblings().removeClass('cur') } }) $('.navitemname').click(function(){ $(this).closest('.navitem').toggleClass('cur').siblings().removeClass('cur'); $('.head').toggleClass('cur'); // $(this).closest('.navitem').siblings().find('.navitemname').removeClass('cur').siblings('.navchild').slideUp(400) }) } $('.conseltop').click(function(){ $(this).closest('.consel').toggleClass('cur') }) $('.indexcsmall .swiper-slide').click(function(){ var i = $(this).index(); $(this).addClass('cur').siblings().removeClass('cur'); icswiper.slideTo(i, 1000, false); }) function makesvg(percentage){ var abs_percentage=Math.abs(percentage).toString(); var percentage_str=percentage.toString(); var svg = '' + '' + '' + ''; return svg } function banner(obj, s){ var banswiper = new Swiper(''+obj+'', { speed: 1000, autoplay: { delay: 6000, disableOnInteraction: false }, effect: 'fade', pagination: { el: ''+obj+' .swiper-pagination', clickable: true }, navigation: { nextEl: ''+obj+' .swiper-button-next', prevEl: ''+obj+' .swiper-button-prev', }, on: { init: function(){ var i = this.activeIndex; $(''+obj+' .swiper-slide').eq(i).find('.textbox').addClass('cur'); setTimeout(function(){ $('.indexban').find('.swiper-pagination').find('.swiper-pagination-bullet').append('
'); var p = $('.indexban').find('.swiper-pagination').find('.swiper-pagination-bullet .circlechart').attr('data-percentage'); $('.indexban').find('.swiper-pagination').find('.swiper-pagination-bullet .circlechart').html( makesvg(p)) $('.indexban').find('.swiper-pagination').find('.swiper-pagination-bullet').eq(0).addClass('one') },500) }, slideChangeTransitionEnd: function(){ var i = this.activeIndex; $(''+obj+' .swiper-slide').eq(i).find('.textbox').addClass('cur'); $(''+obj+' .swiper-slide').eq(i).siblings().find('.textbox').removeClass('cur'); } } }) } $('.searchbtn').click(function(){ $('.searchbox').addClass('cur'); }) $('.searchbox .close').click(function(){ $('.searchbox').removeClass('cur'); }) var abswiper = new Swiper('.about2slide', { pagination: { el: '.about2slide .swiper-pagination', clickable: true }, autoplay: { delay: 5000, disableOnInteraction: false, }, }); $('.about2list .player').click(function(){ var vsrc = $(this).closest('.about2list').attr('vsrc'); $(this).closest('.about2list').find('video').attr('src', ''); if($(this).closest('.about2list').find('video').attr('src') == ""){ $(this).closest('.about2list').find('video').attr('src', vsrc); $(this).closest('.about2list').addClass('cur'); // $(this).closest('.ibvideobox').find('video')[0].load(); var playPromise = $(this).closest('.about2list').find('video')[0].play() // $(this).closest('.iavideobox').find('video')[0].webkitRequestFullScreen(); if (playPromise !== undefined) { playPromise.then(function(){ $(this).closest('.about2list').find('video')[0].play() // $(this).closest('.iavideobox').find('video')[0].webkitRequestFullScreen(); }).catch(function(){ }) } } }) var cvswiper1 = new Swiper('.casevideotopslide', { speed: 1000 }); var cvswiper2 = new Swiper('.casevideobot .swiper-container', { speed: 1000, slidesPerView: 5, spaceBetween: 30, navigation: { nextEl: '.casevideobot .swiper-button-next', prevEl: '.casevideobot .swiper-button-prev', }, breakpoints: { 1024: { slidesPerView: 2, spaceBetween: 15, }, } // on:{ // transitionEnd: function(){ // var i = this.activeIndex; // cvswiper1.slideTo(i, 1500, false); // }, // }, }); var prodswiper = new Swiper('.prodsmallslide .swiper-container', { slidesPerView: 4, spaceBetween: 20, slidesPerGroup: 1, speed:1000, navigation: { nextEl: '.prodsmallslide .swiper-button-next', prevEl: '.prodsmallslide .swiper-button-prev', }, breakpoints: { 1024: { slidesPerView: 3, spaceBetween: 15, }, } }); var salswiper = new Swiper('.sales2slidebox .swiper-container', { slidesPerView: 8, navigation: { nextEl: '.sales2slidebox .swiper-button-next', prevEl: '.sales2slidebox .swiper-button-prev', }, on:{ transitionStart: function(){ var i = this.activeIndex; $('.sales2item').eq(i).addClass('cur').siblings().removeClass('cur') }, }, breakpoints: { 1620: { slidesPerView:6 }, 1440: { slidesPerView:4 }, 1024: { slidesPerView: 1.5 } } }); var icswiper = new Swiper('.inexcbig .swiper-container', { speed:1000, on:{ transitionEnd: function(){ var i = this.activeIndex; if(windw < 1024){ // console.log(i); icsmallswiper.slideTo(i, 1500, false); $('.indexcsmall .swiper-slide').eq(i).addClass('cur').siblings().removeClass('cur') } }, } }); var icsmallswiper = new Swiper('.indexcsmall .swiper-container', { slidesPerView: 5, spaceBetween: 10, slidesPerGroup: 1, slideToClickedSlide: true, navigation: { nextEl: '.indexcsmall .swiper-button-next', prevEl: '.indexcsmall .swiper-button-prev', }, breakpoints: { 1024: { slidesPerView: 3.8, // slidesPerGroup: 3.8, spaceBetween: 10, // centeredSlides: true, // loop: true, // loopFillGroupWithBlank: true, // freeMode: true, }, } }); $('.swiper-slide .player').click(function(){ var vsrc = $(this).closest('.swiper-slide').attr('vsrc'); $(this).closest('.swiper-slide').find('video').attr('src', ''); if($(this).closest('.swiper-slide').find('video').attr('src') == ""){ $(this).closest('.swiper-slide').find('video').attr('src', vsrc); $(this).closest('.swiper-slide').addClass('cur'); // $(this).closest('.ibvideobox').find('video')[0].load(); var playPromise = $(this).closest('.swiper-slide').find('video')[0].play() // $(this).closest('.iavideobox').find('video')[0].webkitRequestFullScreen(); if (playPromise !== undefined) { playPromise.then(function(){ $(this).closest('.swiper-slide').find('video')[0].play() // $(this).closest('.iavideobox').find('video')[0].webkitRequestFullScreen(); }).catch(function(){ }) } } }) function conimgslide(){ var conimgslide = null, imgarry = []; $('[data-content] img').each(function(){ imgarry.push($(this).attr('src')); $(this).click(function(){ var o = $(this).index(); $('[data-imgslide]').addClass('cur'); conimgslide = new Swiper('[data-imgslide] .swiper-container', { zoom: true, navigation: { nextEl: '[data-imgslide] .swiper-button-next', prevEl: '[data-imgslide] .swiper-button-prev', }, }); conimgslide.slideTo(i, 0, false); }) }) for(var i=0;i