1var slideWrapper = $('.box__banner .slider'); 2 3function playPauseVideo(slick, control){ 4 var currentSlide, slideType, startTime, player, video; 5 6 currentSlide = slick.find(".slick-current"); 7 slideType = currentSlide.attr("class").split(" ")[1]; 8 9 if (slideType === "video") { 10 video = currentSlide.find("video").get(0); 11 if (video != null) { 12 if (control === "play"){ 13 video.play(); 14 } else { 15 video.pause(); 16 } 17 } 18 } else if (slideType === "image") { 19 20 } 21} 22 23function refreshSlider(){ 24 function reloadSlidePromotion(){ 25 $('.slide__promotion .frame').addClass('reload'); 26 } 27 28 $('.slide__promotion .frame').sly({ 29 horizontal: 1, 30 autoplay: true, 31 autoplaySpeed: 5000, 32 itemNav: 'basic', 33 smart: 1, 34 activateOn: null, 35 mouseDragging: 1, 36 touchDragging: 1, 37 releaseSwing: 1, 38 startAt: 0, 39 scrollBar: $('.slide__promotion').find('.scrollbar'), 40 pagesBar: $('.slide__promotion').find('.pages'), 41 activatePageOn: null, 42 speed: 300, 43 elasticBounds: 1, 44 easing: 'easeOutExpo', 45 dragHandle: 1, 46 dynamicHandle: 1, 47 clickBar: 1, 48 scrollSource: false 49 }); 50 51 setTimeout(function(){ 52 console.log('=== refreshhhhh!!! ====='); 53 reloadSlidePromotion(); 54 }, 2000); 55 56 setTimeout(() => { 57 AOS.init(); 58 }, "3000") 59} 60 61$(function(){ 62 /* 63 slideWrapper.on("init", function(slick){ 64 slick = $(slick.currentTarget); 65 setTimeout(function(){ 66 if($('.box__banner.showing .slider .video').hasClass('slick-current')){ 67 playPauseVideo(slick,"play"); 68 slideWrapper.slick('pause'); 69 70 $('.box__banner.showing .slider .video.slick-current').on('ended',function(){ 71 console.log('Video has ended!'); 72 }); 73 } 74 else if($('.box__banner.showing .slider .image').hasClass('slick-current')){ 75 slideWrapper.slick('play'); 76 } 77 }, 1000); 78 }); 79 80 slideWrapper.on("beforeChange", function(event, slick) { 81// if($('.main-slider .youtube, .main-slider .video').hasClass('slick-current')){ 82// slick = $(slick.$slider); 83// playPauseVideo(slick,"pause"); 84// } 85// else if($('.main-slider .image').hasClass('slick-current')){ 86// slideWrapper.slick('pause'); 87// } 88 89 slick = $(slick.$slider); 90 playPauseVideo(slick,"pause"); 91 slideWrapper.slick('pause'); 92 }); 93 94 slideWrapper.on("afterChange", function(event, slick) { 95 if($('.box__banner.showing .slider .video').hasClass('slick-current')){ 96 slick = $(slick.$slider); 97 playPauseVideo(slick,"play"); 98 99 $('.box__banner.showing .slider .video.slick-current video').on('ended',function(){ 100 slideWrapper.slick('play'); 101 console.log('Video has ended!'); 102 }); 103 } 104 else if($('.box__banner.showing .slider .image').hasClass('slick-current')){ 105 slideWrapper.slick('play'); 106 } 107 108// slick = $(slick.$slider); 109// playPauseVideo(slick,"play"); 110// slideWrapper.slick('play'); 111 112 // if($('.main-slider .item.slick-current').hasClass('image')){ 113 // slideWrapper.slick('play'); 114 // console.log('this is image'); 115 // } else{ 116 // slideWrapper.slick('pause'); 117 // console.log('this is not image'); 118 // } 119 }); 120 121 slideWrapper.slick({ 122 autoplaySpeed: 4000, 123 speed: 600, 124 infinite: true, 125 arrows: false, 126 dots: false, 127 cssEase: "cubic-bezier(0.87, 0.03, 0.41, 0.9)" 128 }); 129 130// $('oembed').on('ended',function(){ 131// console.log('Video Complete') 132// $('.sliderMain').slick('slickPlay'); 133// }); 134 $('.box__banner.showing .slider .video.slick-current video').on('ended',function(){ 135 console.log('Video has ended!'); 136 }); 137 138 $('.box__banner-main .box__banner .slider .item').css({height: $(window).height()}); 139 */ 140}); 141 142$(window).on('resize', function(){ 143 // $('.box__banner-main .box__banner .slider .item').css({height: $(window).height()}); 144});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.