$(function () { var wW = $(window).width(); //banner var swiper = new Swiper("#banner .swiper-container", { loop: true, autoplay: false, //autoplay: {移入暂停自动播放 // pauseOnMouseEnter: true, //}, // autoplay: { // delay: 5000, // stopOnLastSlide: false, // disableOnInteraction: false, // }, navigation: { nextEl: ".bannerpc-next", prevEl: ".bannerpc-prev", }, pagination: { el: ".banner-scrollbar", }, //mousewheel: true, //keyboard: true, on: { init: function (banner_swiper) { var thisdiv = $(`#banner .swiper-container .swiper-wrapper .swiper-slide:nth-child(${this.activeIndex + 1})`); var thisvideo = thisdiv.find("video"); if (thisvideo.length == 1) { thisvideo[0].play(); if (thisvideo[0].play()) { thisdiv.find(".video").hide(); $("#banner .swiper-search").addClass('active'); } } // thisvideo.bind('ended', function () { // swiper.slideNext(); // }); }, slideChangeTransitionEnd: function () { var _this = $("#banner .swiper-container"); var videoList = _this.find("video"); var t1 = this.activeIndex; for (var i = 0; i < videoList.length; i++) { if (t1 == i) { videoList[i].play(); // if (videoList[i].play()) { // $(".swiper-wrapper .swiper-slide:nth-child(" + (t1 + 1) + ")").find(".video").hide(); // $("#banner .swiper-search").addClass('active'); // } // var thisdiv = $(".swiper-wrapper .swiper-slide:nth-child(" + (t1 + 1) + ")"); // var thisvideo = thisdiv.find("video"); // thisvideo.bind('ended', function () { // swiper.slideNext(); // }); } else { // videoList[i].pause(); /*if(videoList[i].pause()){ $('#banner .swiper-slide .video').show(); }*/ } } }, }, }); $("#banner .swiper-slide").click(function () { return var _thisvideo = $(this).find("video"); var videourl = $(this).attr('url');//获取视频地址 var isplay = _thisvideo.trigger("play"); if (videourl == '') { _thisvideo.attr('src', videourl);//赋值给video视频地址 }; if (_thisvideo.hasClass('pause')) { _thisvideo.trigger("pause"); $(this).find(".video").show(); _thisvideo.removeClass('pause'); $(".swiper-search").removeClass("active"); } else { _thisvideo.trigger("play"); $(this).find(".video").hide(); _thisvideo.addClass('pause'); $(".swiper-search").addClass("active"); } //播放完成加载文字图片 $(_thisvideo).bind("ended", function () { $(this).find(".video").show(); $(".swiper-search").removeClass("active"); }); }); //方案 手风琴效果 $(".insoft-main .mitem").mouseover(function () { $(".insoft-main .mitem").attr("data-on", ""); $(this).attr("data-on", "on"); }) //关于我们 点击显示隐藏二维码 $(".abt-txt ul li.abtlink").click(function () { $(this).toggleClass('active'); }); //新闻轮播 var mySwiper = new Swiper('.news .swiper-container', { loop: true, autoplay: false, slidesPerView: 1, navigation: { nextEl: '.news-next', prevEl: '.news-prev', }, paginationClickable: false }); //数字跳动 $('body').running(); });