$(function () { //disableScroll() $("#videobox video").click(function(){ $("#videobox").fadeOut() }) document.addEventListener("WeixinJSBridgeReady",function() { video.play(); }, false); document.querySelector("#videobox video").addEventListener("ended",function() { //$("#videobox").fadeOut(600) $("#videobox").addClass("videoEnd") enableScroll() }, false); $('.mbanner .news_list').slick({ infinite: true, slidesToShow: 1, autoplay: false, slidesToScroll: 1, dots: true, arrows: false, }); $(".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(); } }) var mySwiper21 = new Swiper('.post-21 .swiper',{ spaceBetween:$(".post-21 .example").width(), slidesPerView: 2, slidesPerGroup:2, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, breakpoints: { 999: { //当屏幕宽度大于等于320 slidesPerGroup:1, slidesPerView:4, }, }, }) var mySwiper61 = new Swiper('.post-61 .swiper',{ spaceBetween:$(".post-61 .example").width(), slidesPerView: 2, slidesPerGroup:2, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, breakpoints: { 999: { //当屏幕宽度大于等于320 slidesPerGroup:1, slidesPerView:4, }, }, }) function disableSwiper(){ if($(window).width()<768){ mySwiper21.disable() mySwiper61.disable() } } disableSwiper() var mySwiper = new Swiper('.swiper1',{ pagination: { el: '.swiper-pagination', clickable:true, }, //spaceBetween:$(".post-31 .example").width(), slidesPerGroup:1, slidesPerView: 1, grid: { fill: 'column', rows: 2, }, breakpoints: { 768: { //当屏幕宽度大于等于320 slidesPerGroup:2, slidesPerView:2, grid: { fill: 'rows', rows: 1, }, }, }, }) if('ontouchstart' in window ){ $(".post-51 li.news").click(function(e){ e.stopPropagation() $(".post-51 li.news").removeClass("show") $(this).addClass("show"); var tit=$(this).find(".news_title").text(); var url=$(this).find("a").attr("href"); var text=$(this).find(".news_text").text(); $(".detail ._title a").attr("href",url) $(".detail ._title a").text(tit) $(".detail ._text").text(text) $(".detail").show(); $("html").addClass("showDetail") }) }else{ $(".post-51 li.news").hover(function(e){ e.stopPropagation() $(".post-51 li.news").removeClass("show") $(this).addClass("show"); var tit=$(this).find(".news_title").text(); var url=$(this).find("a").attr("href"); var text=$(this).find(".news_text").text(); $(".detail ._title a").attr("href",url) $(".detail ._title a").text(tit) $(".detail ._text").text(text) $(".main5 .detail").show(); $("html").addClass("showDetail") },function(){ $(".detail").hide(); }) $(".post-51 li.news").click(function(){ window.open($(this).find("a").attr("href"),"_blank") }) } $("body,html").click(function(){ $(".detail").hide(); $("html").removeClass("showDetail") }) $(".main4 .sudy-tab").sudyTab({ handle: ".tab-menu li", content: ".tab-con .post", trigger: "mouseenter", start: 1, autoPlay: { active: false } }); $('.post-12 .news_list').slick({ slide: 'li', //滑动元素查询 dots: true, infinite: true, speed: 500, autoplay: true, autoplaySpeed: 5000, fade: false, slidesToShow: 1, slidesToScroll: 1, useCSS: false, //使用 CSS3 过度 arrows: false, //左右箭头 }); /* $('.post-61 .news_list').slick({ slide: 'li', //滑动元素查询 dots: false, infinite: true, speed: 500, autoplay: true, autoplaySpeed: 10000, fade: false, slidesToShow: 8, slidesToScroll: 1, useCSS: false, //使用 CSS3 过度 arrows: true, //左右箭头 responsive: [ { breakpoint: 999, settings: { slidesToShow: 3, slidesToScroll: 1, } }, { breakpoint: 479, settings: { slidesToShow: 2, slidesToScroll: 1 } } ] }); */ });