$(document).ready(function() { new swiper('.gallery-video', { speed: 1000, loopedslides: 3, slidesperview : "auto", grabcursor : true, centeredslides:true, // spacebetween : 10, parallax: true, loop: true, autoheight: true, autoplay: false, navigation: { nextel: '.gallery-video .gallery-prev.next', prevel: '.gallery-video .gallery-prev.prev', }, on: { progress: function(progress) { for (var i = 0; i < this.slides.length; i++) { let slide = this.slides.eq(i); let slideprogress = this.slides[i].progress; let modify = 1; if (math.abs(slideprogress) > 1) { modify = (math.abs(slideprogress) - 1) * 0.3 + 1; } let translate = slideprogress * modify * 69.44 + '%'; let scale = 1 - math.abs(slideprogress) / 5.6; let zindex = 999 - math.abs(math.round(10 * slideprogress)); slide.transform('translatex(' + translate + ') scale(' + scale + ')'); slide.css('zindex', zindex); slide.css('opacity', 1); if (math.abs(slideprogress) > 3) { slide.css('opacity', 0); } } }, settransition: function(transition) { for (var i = 0; i < this.slides.length; i++) { var slide = this.slides.eq(i) slide.transition(transition); } }, }, breakpoints: { 860: { slidesperview: 1, }, 1280: { slidesperview: "auto", } } }); var flvplayer = null $(document).on("click", '.videobtns', function(){ var srcvideo = $(this).attr("data-src"); console.log('%c [ srcvideo ]-58', 'font-size:13px; background:pink; color:#bf2c9f;', srcvideo) if(srcvideo){ $("body").addclass("videoshow"); videoelement = document.getelementbyid('videos'); if (flvjs.issupported() && srcvideo.split('.flv').length > 1) { $(".video-pop-wrap").removeclass("showiframe") flvplayer = flvjs.createplayer({ type: 'flv', url: srcvideo },{ enableworker: false, enablestashbuffer: false, autocleanupsourcebuffer: true }); flvplayer.attachmediaelement(videoelement); flvplayer.load(); flvplayer.play(); }else{ $(".video-pop-wrap").addclass("showiframe") $(".iframvideo").attr('src', srcvideo) } } }); $(document).on("click", '.video-close', function(){ $("body").removeclass("videoshow"); flvplayer.pause(); $(".video-pop-wrap .iframvideo").attr("src", '') }) });