$require(['swiper'], function () { var special_a = new swiper('.special_a', { speed: 800, parallax: true, autoplay: { delay: 10000, pauseonmouseenter: true, }, navigation: { nextel: '.special_a .p_btn_next', prevel: '.special_a .p_btn_prev', }, pagination: { el: '.special_a .p_pagenation', }, }) //6.6.2之前的版本需要通过代码实现此功能 special_a.el.onmouseover = function () { special_a.autoplay.stop(); } special_a.el.onmouseout = function () { special_a.autoplay.start(); } }) $(function () { // 播放 $(".p_videoinfo a").attr("href", "javascript:;"); $(".p_videoinfo a").click(function () { $(this).parents(".p_videoinfo").addclass("out"); $(this).parents(".p_videoinfo").prev().find(".videocontent").addclass("in"); let vibox = $(this).parents(".p_videoinfo").prev().find("video")[0]; $(vibox).attr('playsinline', 'true'); $(vibox).attr('webkit-playsinline', 'true'); if (vibox.paused == true) { vibox.play(); } else { vibox.pause(); } }); // 暂停 $('.gb').click(function () { $(this).parents(".p_video").next().removeclass("out"); $(this).parents(".videocontent").removeclass("in"); let vibox = $(this).prev().find('.video')[0]; if (vibox.paused == true) { vibox.play(); } else { vibox.pause(); } }); });