$(function () { $('.mbanner .news_list').on('init', function (e, s) { $('.mbanner .banner-pro').addClass('ani'); }); $('.mbanner .news_list').slick({ infinite: true, slidesToShow: 1, autoplay: true, autoplaySpeed: 6000, speed: 800, slidesToScroll: 1, dots: true, arrows: true, }); $(".mbanner .news .news_video").each(function () { if ($(this).find("video").attr("src") == "") { $(this).hide(); $(this).siblings(".news_imgs").show(); } else { $(this).show(); $(this).siblings(".news_imgs").hide(); } }) $('.mbanner .news_list').on('beforeChange', function (e, s, c) { $('.mbanner .banner-pro').removeClass('ani play'); }); $(".mbanner .news_list").on("afterChange", function (event, slick, currentSlide) { // 杩涘害鏉°€ $('.mbanner .banner-pro').addClass('ani'); /*if ($(".mbanner").find("video").length > 0) { if ($(".slick-active").find("video").size() > 0) { var videoTime = $(".slick-active").find("video")[0].duration; $('.mbanner .banner-pro').css({ '-webkit-animation-duration': videoTime + 's' }); $(".mbanner .news_list").slick("slickPause"); $(".slick-active").find("video").bind("ended", function () { if (!$('.mbanner .banner-btn').hasClass('pause')) { $(".mbanner .news_list").slick("slickPlay"); } else { $(".mbanner .news_list").slick("slickPause"); } }); } else { $('.mbanner .banner-pro').attr("style", ""); $(".mbanner").find("video")[0].pause(); } }*/ }); $(".post1 .tt .title").each(function(){ var str=$(this).text(); $(this).html(''+str.substring(0,2)+''+str.slice(2,str.length)) }) $(".main2").sudyTab({ handle: ".kz > li", content: ".nr > li", trigger: "mouseenter", start: 1, autoPlay: { active: false } }); $('.post-13 .news_list').on('init', function (e, s) { $('.post-13 .banner-pro').addClass('ani'); }); $('.post-13 .news_list').slick({ slide: 'li', //婊戝姩鍏冪礌鏌ヨ dots: false, infinite: true, speed: 800, autoplay: true, autoplaySpeed: 4000, fade: false, slidesToShow: 1, slidesToScroll: 1, useCSS: false, //浣跨敤 CSS3 杩囧害 arrows: true, //宸﹀彸绠ご responsive: [ ] }); $('.post-13 .news_list').on('beforeChange', function (e, s, c) { $('.post-13 .banner-pro').removeClass('ani play'); }); $(".post-13 .news_list").on("afterChange", function (event, slick, currentSlide) { // 杩涘害鏉°€ $('.post-13 .banner-pro').addClass('ani'); }); $('.post-15 .news_list').slick({ slide: 'li', //婊戝姩鍏冪礌鏌ヨ dots: true, infinite: true, speed: 500, autoplay: true, autoplaySpeed: 5000, fade: false, slidesToShow: 4, slidesToScroll: 2, useCSS: false, //浣跨敤 CSS3 杩囧害 arrows: false, //宸﹀彸绠ご responsive: [ { breakpoint: 999, settings: { slidesToShow: 3, slidesToScroll: 2, } }, { breakpoint: 767, settings: { slidesToShow: 2, slidesToScroll: 2, } }, { breakpoint: 479, settings: { slidesToShow: 1, slidesToScroll: 1, } } ] }); $('.post-25 .news_list').slick({ slide: 'li', //婊戝姩鍏冪礌鏌ヨ dots: true, infinite: true, speed: 500, autoplay: true, autoplaySpeed: 5000, fade: false, slidesToShow: 4, slidesToScroll: 2, useCSS: false, //浣跨敤 CSS3 杩囧害 arrows: false, //宸﹀彸绠ご responsive: [ { breakpoint: 999, settings: { slidesToShow: 3, slidesToScroll: 2, } }, { breakpoint: 767, settings: { slidesToShow: 2, slidesToScroll: 2, } }, { breakpoint: 479, settings: { slidesToShow: 1, slidesToScroll: 1, } } ] }); $('.post-31 .news_list').slick({ slide: 'li', //婊戝姩鍏冪礌鏌ヨ dots:true, infinite: true, speed: 800, autoplay: true, autoplaySpeed: 5000, fade: false, slidesToShow: 4, slidesToScroll: 1, useCSS: false, //浣跨敤 CSS3 杩囧害 arrows: false, //宸﹀彸绠ご responsive: [ //鏂偣瑙﹀彂璁剧疆 { breakpoint: 1200, //鍒嗚鲸鐜囦箣涓?涓嶅寘鍚缃垎杈ㄧ巼鏈韩) settings: { //鍙傛暟璁剧疆 slide: 'li', //婊戝姩鍏冪礌鏌ヨ slidesToShow: 3, //骞荤伅鐗囨瘡灞忔樉绀轰釜鏁 slidesToScroll: 1, //骞荤伅鐗囨瘡娆℃粦鍔ㄤ釜鏁 infinite: true //寰幆鎾斁 } }, { breakpoint: 960, settings: { slide: 'li', slidesToShow: 2, slidesToScroll: 1, infinite: true } }, { breakpoint: 768, settings: { slide: 'li', slidesToShow: 2, slidesToScroll: 1, infinite: true } }, { breakpoint: 480, settings: { slide: 'li', slidesToShow: 1, slidesToScroll: 1, infinite: true } }, { breakpoint: 320, settings: { slide: 'li', slidesToShow: 1, slidesToScroll: 1, infinite: true } } ] }); $('.post-32 .news_list').slick({ slide: 'li', //婊戝姩鍏冪礌鏌ヨ dots: false, infinite: true, speed: 500, autoplay: true, autoplaySpeed: 5000, fade: false, slidesToShow: 5, slidesToScroll: 1, useCSS: false, //浣跨敤 CSS3 杩囧害 arrows: false, //宸﹀彸绠ご responsive: [ { breakpoint: 999, settings: { slidesToShow: 3, slidesToScroll: 1, } }, { breakpoint: 767, settings: { slidesToShow: 2, slidesToScroll: 1, } }, { breakpoint: 479, settings: { slidesToShow: 2, slidesToScroll: 1, } } ] }); $('.post.post1.post-32.mbox li.news .numCX').each(function(){ var key=$(this).text(); if(key=='+'){ $(this).css('display','none') $(this).parent().children(".jij").css('display','none') } }) $('.post.post1.post-32.mbox li.news .numCX').each(function(){ var key=$(this).text(); if(key==''){ $(this).css('display','none') $(this).parent().children(".jij").css('display','none') } }) $('.post.post1.post-32.mbox li.news .numCX').each(function(){ var key=$(this).text(); if(key=='0'){ $(this).css('display','none') $(this).parent().children(".jij").css('display','none') } }) $('.post-22 .ul1').slick({ slide: 'li', //婊戝姩鍏冪礌鏌ヨ dots: true, infinite: true, speed: 400, autoplay: false, autoplaySpeed: 6000, fade: false, vertical:true, //鏄惁寮€鍚瀭鐩存粦鍔ㄦā寮 slidesToShow: 2, slidesToScroll: 1, useCSS: false, //浣跨敤 CSS3 杩囧害 arrows: false, //宸﹀彸绠ご responsive: [ ] }); $(".post-22 .news_list li.news").each(function(index, el){ var day=$(this).find("span.ny").text().split("-")[0]; var yy=$(this).find("span.ny").text().split("-")[1]; var mm=$(this).find("span.ny").text().split("-")[2]; $(this).find("span.ny").html(day+"骞?+yy+"鏈?+mm+"鏃?) }); $(".post-23 .news_list li.news").each(function(index, el){ var day=$(this).find("span.ny").text().split("-")[0]; var yy=$(this).find("span.ny").text().split("-")[1]; var mm=$(this).find("span.ny").text().split("-")[2]; $(this).find("span.ny").html(day+"骞?+yy+"鏈?+mm+"鏃?) }); $('.post-23 .news_list').slick({ slide: 'li', //婊戝姩鍏冪礌鏌ヨ dots: true, infinite: true, speed: 800, autoplay: false, autoplaySpeed: 6000, fade: false, slidesToShow: 2, slidesToScroll: 1, useCSS: false, //浣跨敤 CSS3 杩囧害 arrows: false, //宸﹀彸绠ご responsive: [ ] }); $('.post-42 .news_list').slick({ slide: 'li', //婊戝姩鍏冪礌鏌ヨ dots: false, infinite: true, speed: 800, autoplay: true, autoplaySpeed: 8000, fade: false, slidesToShow: 1, slidesToScroll: 1, useCSS: false, //浣跨敤 CSS3 杩囧害 arrows: false, //宸﹀彸绠ご responsive: [ ] }); }); $(function () { const throttle = (fn, interval) => { let isThrottled = false return (...args) => { if (!isThrottled) { isThrottled = true setTimeout(() => { fn.apply(this, args) isThrottled = false }, interval) } } } , addFirstDom = (nodeList, callback) => { nodeList.forEach((value, index) => { const svgDom = document.createElement('div'), firstDom = value.firstChild svgDom.id = 'linkSvg' + index value.insertBefore(svgDom, firstDom) const svg = typeof Vivus !== 'undefined' ? new Vivus(`linkSvg${index}`, { duration: 100, start: 'inViewport', file: `${path()}images/jdt.svg` }, callback) : null svgDom.parentElement.parentElement.addEventListener('mouseover', () => { svg.getStatus() === 'end' ? svg.reset().play() : void 0 }) }) } , path =()=>{ const ip = window.location.origin const link =document.querySelectorAll('link') for(i of link){ if(window.location.origin === 'null') return 'css/'; if(i.type == 'image/x-icon'){ return i.href.replace(ip,'').replace('favicon.ico','') } } } const linkDom = document.querySelectorAll(".post.post1.post-25.mbox li .wm"); addFirstDom(linkDom); });