var swiper = new Swiper('.swiper-container-banner', { loop: true, pagination: '.swiper-pagination-index-banner', nextButton: '.swiper-button-next1', prevButton: '.swiper-button-prev1', paginationClickable: true, paginationElement : 'span', spaceBetween: 0, effect: 'fade', autoplay: 5000, speed: 1000, TouchControl: true }); var swiper1 = new Swiper('.swiper-container-pro1', { pagination: '.swiper-pagination-index_pro1', slidesPerView: 3, slidesPerColumn: 1, paginationClickable: true, paginationElement : 'span', nextButton: '', prevButton: '', spaceBetween: 20, autoplay: 5000, speed: 1000, effect: '', TouchControl: true, observer:true, observeParents:true, breakpoints:{ 768: { slidesPerView:2, }, 450: { slidesPerView:1, } } }); $(function () { //视频 jsModern.video("#video"); //播放视频 $(".VideoBtn").click(function () { var video = document.getElementById("videoShow"); video.play(); $('.VideoBtn').hide(); }) //监听视频的播放状态 var video = document.getElementById("videoShow"); video.oncanplay = function () { $(".VideoBtn").show(); //$("#video").attr("poster",""); } //视频播放事件 video.onplay = function () { $("#videoShow").attr("poster", ""); $(".VideoBtn").hide(); }; video.onplaying = function () { $(".VideoBtn").hide(); }; //视频暂停事件 video.onpause = function () { $(".VideoBtn").show(); }; //点击视频周围暂停播放图片出现 video.onclick = function () { if (video.paused) { $(".VideoBtn").hide(); video.play(); } else { $(".VideoBtn").show(); video.pause(); } }; });