锘?(function () { new WOW().init(); //缃戠珯鏄惁鍔犺浇瀹屾瘯: document.onreadystatechange = function () { if (document.readyState == "complete") { console.log("椤甸潰鍔犺浇瀹屾瘯") } } $('.newsdetail .content').find('p').css('text-indent', '2em').css('font-family', '瀹嬩綋').css('font-size', '15pt').css('line-height', '200%'); $('.newsdetail .content').find('div').css('text-indent', '2em').css('font-family', '瀹嬩綋').css('font-size', '15pt').css('line-height', '200%'); $('.newsdetail .content').find('span').css('text-indent', '2em').css('font-family', '瀹嬩綋').css('font-size', '15pt').css('line-height', '200%'); $('.newsdetail .content').css('text-indent', '2em').css('font-family', '瀹嬩綋').css('font-size', '15pt').css('line-height', '200%'); var banobj = ""; //瀵艰埅鍜宐anner: var windowwidth = $(window).width(); if (windowwidth < 993) { $('.navitem .navfirst').click(function () { $(this).toggleClass('cur').siblings('.childnavbox').slideToggle(); $(this).parent('.navitem').siblings().find('.navfirst').removeClass('cur'); $(this).parent('.navitem').siblings().find('.childnavbox').hide(); }) $('header .return').click(function () { $('header,header .navbtnbox,header .navitems').removeClass('cur') }) banobj = ".m-banner"; //澶撮儴璇█ $('.lanbox').click(function () { $(this).find('.lantextbox').slideToggle(); }) //澶撮儴鎼滅储 $('.pcsearch .btnicon').click(function () { $(this).siblings('.pcsearchbox').slideToggle(); }) // 瀵艰埅鏉 $('.navbtnbox').click(function () { $(this).toggleClass('cur'); $('.navitems').toggleClass('cur'); $('header').toggleClass('cur'); }) //浜у搧 $('.prodetailitem').click(function () { $(this).toggleClass('cur').find('.pdlchildnavbox').slideToggle(250); $(this).siblings().removeClass('cur').find('.pdlchildnavbox').slideUp(200); }) $('.indexnewscate').click(function () { $(this).addClass('cur').siblings().removeClass('cur'); $('.indexnewsitem').eq($(this).index()).addClass('cur').siblings().removeClass('cur'); }) $('.wechat .btnicon').click(function () { $(this).closest('.wechat').toggleClass('cur'); $(this).closest('header').toggleClass('cur') }) } else { banobj = ".indexbanner"; //浜у搧鍒嗙被 var pronavstatus = false; $('.prodetailitem').hover(function () { if (pronavstatus == false) { $(this).find('.pdlchildnavbox').slideDown(250); $(this).siblings().find('.pdlchildnavbox').slideUp(200); pronavstatus = true; } }, function () { $(this).find('.pdlchildnavbox').slideUp(200); pronavstatus = false; }) //浜烘墠鐞嗗康 function idleftH() { $('.ideaboxleft').css('height', $('.ideaboximg').height()) } idleftH() $(window).resize(function () { idleftH() }) //棣栭〉搴旂敤棰嗗煙 $('.indexappliitem').hover(function () { $(this).addClass('cur').siblings().removeClass('cur') }) //棣栭〉妗堜緥 var swiper = new Swiper('.indexcase .swiper-container', { slidesPerView: 3, spaceBetween: 30, navigation: { nextEl: '.indexcase .swiper-button-next', prevEl: '.indexcase .swiper-button-prev', } }); } if ($('' + banobj + ' .swiper-slide').length > 1) { var banswiper = new Swiper('' + banobj + '', { autoplay: { delay: 3500, disableOnInteraction: false, }, loop: true, pagination: { el: '' + banobj + ' .swiper-pagination', clickable: true, } }); } else { var banswiper = new Swiper('' + banobj + '', { // autoplay: { // delay: 3500, // disableOnInteraction: false, // }, // loop: true, pagination: { el: '' + banobj + ' .swiper-pagination', clickable: true, } }); } //棣栭〉绗竴灞 var indexgalleryTop = new Swiper('.indexabot-l .gallery-top', { spaceBetween: 0, loop: true, loopedSlides: 2, thumbs: { swiper: indexgalleryThumbs }, autoplay: { delay: 4500, disableOnInteraction: false, }, effect: 'fade', fadeEffect: { crossFade: true, } }); var indexgalleryThumbs = new Swiper('.indexabot-r .gallery-thumbs', { spaceBetween: 40, slidesPerView: 2, freeMode: true, loop: true, loopedSlides: 2, watchSlidesVisibility: true, watchSlidesProgress: true, slidesPerGroup: 1, navigation: { nextEl: '.indexabot-r .swiper-button-next', prevEl: '.indexabot-r .swiper-button-prev', }, autoplay: { delay: 4500, disableOnInteraction: false, }, breakpoints: { 993: { slidesPerView: 2, spaceBetween: 30, freeMode: false, loop: false }, 768: { freeMode: false, slidesPerView: 1, spaceBetween: 0, loop: false } }, on: { transitionStart: function () { indexgalleryTop.slideTo(this.activeIndex, 500, false) } } }); if (windowwidth < 993) { $('.indexabot-r .swiper-slide').each(function () { var src = $(this).find('a').attr('src'); $(this).find('a').attr('href', src) }) } //棣栭〉鍏充簬鎴戜滑 if (windowwidth > 1200) { $('.indexbleftitem').each(function () { var img = $(this).find('.icon').attr('imgsrc'); $(this).find('.icon').css('background-image', 'url(' + img + ')'); if ($(this).hasClass('cur')) { var imgcur = $(this).find('.icon').attr('imgcursrc'); $(this).find('.icon').css('background-image', 'url(' + imgcur + ')'); } }) $('.indexbleftitem').hover(function () { var imgcur = $(this).find('.icon').attr('imgcursrc'); $('.indexbleftitem').each(function () { var imga = $(this).find('.icon').attr('imgsrc'); $(this).find('.icon').css('background-image', 'url(' + imga + ')'); }) $(this).find('.icon').css('background-image', 'url(' + imgcur + ')'); $(this).addClass('cur').siblings().removeClass('cur'); $('.indexbrightitem').eq($(this).index()).addClass('cur').siblings().removeClass('cur'); }) $('.indexcbox .swiper-slide').hover(function () { $(this).addClass('cur').removeClass('cur2').siblings().removeClass('cur').addClass('cur2'); }, function () { $('.indexcbox .swiper-slide').removeClass('cur2').removeClass('cur') }) } else { var swiper = new Swiper('.indexcbox .swiper-container', { slidesPerView: 1, spaceBetween: 0, pagination: { el: '.indexcbox .swiper-pagination', clickable: true, } }) } //杩斿洖椤堕儴 function sctop() { var ht = $('.indexban').height(); $(window).scroll(function () { var s = $(this).scrollTop(); if (s > ht) $('.scrolltop').addClass('cur'); else $('.scrolltop').removeClass('cur'); }) $('.scrolltop').click(function () { $('html,body').animate({ scrollTop: 0 }, 500) }) } sctop() //瀛愰〉闈㈠瓙绾у鑸睍寮€浜嬩欢 $('[pagenavclick]').on('touchstart', function () { $(this).toggleClass('cur').siblings('[showbox]').slideToggle(200) }) //鍏徃绠€浠 //$('[pagevideo] video').click(function () { // $('[pagevideo] .player').show(); // $(this)[0].pause(); //}) $('[pagevideo] .player').click(function () { $(this).hide(); $(this).siblings('video')[0].play(); $(this).siblings('video').attr('controls', true); //$(this).siblings('video').css({ 'object-fit': 'fill' }) }) //鍚堜綔浼欎即 var swiper = new Swiper('.panterslider .swiper-container', { slidesPerView: 3, spaceBetween: 40, slidesPerGroup: 1, navigation: { nextEl: '.panterslider .swiper-button-next', prevEl: '.panterslider .swiper-button-prev', }, breakpoints: { 1200: { slidesPerView: 2, spaceBetween: 40, }, 768: { slidesPerView: 1, spaceBetween: 0, } } }) //鍙戝睍鍘嗙▼ var galleryThumbs = new Swiper('.deve .gallery-thumbs .swiper-container', { spaceBetween: 0, slidesPerView: 10, freeMode: true, watchSlidesVisibility: true, watchSlidesProgress: true, navigation: { nextEl: '.deve .gallery-thumbs .swiper-button-next', prevEl: '.deve .gallery-thumbs .swiper-button-prev', }, breakpoints: { 1440: { slidesPerView: 8, spaceBetween: 0, }, 1366: { slidesPerView: 6, spaceBetween: 0, }, 936: { slidesPerView: 4, spaceBetween: 0, }, 768: { slidesPerView: 3, spaceBetween: 0, } } }); var galleryTop = new Swiper('.deve .gallery-top', { spaceBetween: 0, thumbs: { swiper: galleryThumbs } }); // $('.proitem .player').click(function(){ // $(this).siblings('video')[0].play(); // $(this).hide() // }) // $('.proitem .video video').click(function(){ // $(this)[0].pause(); // $(this).siblings('.player').show(); // }) $('.indexd .player').click(function () { var vsrc = $(this).closest('.videobox').attr('vsrc'); $(this).closest('.videobox').find('video').attr('src', ''); $(this).closest('.videobox').removeClass('animated'); if ($(this).closest('.videobox').find('video').attr('src') == "") { $(this).closest('.videobox').find('video').attr('src', vsrc); $(this).closest('.videobox').addClass('cur'); $(this).closest('.videobox').find('video')[0].play(); $(this).closest('.videobox').find('video').attr('controls', true); } }) $('.indexban .player').click(function () { banswiper.autoplay.stop(); var vsrc = $(this).closest('.videobox').attr('vsrc'); $(this).closest('.videobox').find('video').attr('src', '') if ($(this).closest('.videobox').find('video').attr('src') == "") { $(this).closest('.videobox').find('video').attr('src', vsrc); $(this).closest('.videobox').addClass('cur'); var playPromise = $(this).closest('.videobox').find('video')[0].play(); $(this).closest('.videobox').find('video').attr('controls', true); if (playPromise !== undefined) { playPromise.then(function () { $(this).closest('.videobox').find('video')[0].play() $(this).closest('.videobox').find('video')[0].webkitRequestFullScreen(); }).catch(function () { }) } } }) $('.proitem .player').click(function () { var vsrc = $(this).closest('.video').attr('vsrc'); $(this).closest('.proitem').removeClass('animated'); $(this).closest('.video').find('video').attr('src', ''); if ($(this).closest('.video').find('video').attr('src') == "") { $(this).closest('.video').find('video').attr('src', vsrc); $(this).closest('.video').addClass('cur'); // $(this).closest('.ibvideobox').find('video')[0].load(); var playPromise = $(this).closest('.video').find('video')[0].play(); $(this).closest('.video').find('video').attr('controls', true); // $(this).closest('.video').find('video')[0].webkitRequestFullScreen(); if (playPromise !== undefined) { playPromise.then(function () { $(this).closest('.video').find('video')[0].play() // $(this).closest('.iavideobox').find('video')[0].webkitRequestFullScreen(); }).catch(function () { }) } } }) $('.proitem .video video').click(function () { $(this)[0].pause(); $(this).closest('.video').removeClass('cur'); }) $('.topA').click(function () { $('body,html').animate({ scrollTop: 0 }, 500); }) $('.sideBar').find('li').hover( function () { $(this).addClass('liNow'); }, function () { $(this).removeClass('liNow'); } ) })