').attr({ src: imageData, width: 1680, height: 500 }); $(this).append(img); }); } }, after: function(slider) { var tryToGoNextTimeout; function tryToGoNextAfterDelay(slideObj, delay) { clearTimeout(tryToGoNextTimeout); if (!slideObj) { console.error('No slideObj!'); return false; } var isVideoPlaying = slideObj.hasClass('video-playing'); if (!delay) { console.error('No delay!'); return false; } tryToGoNextTimeout = setTimeout(function() { isVideoPlaying = $('#metaslider_21').find('li.flex-active-slide').hasClass('video-playing'); if (isVideoPlaying) {tryToGoNextAfterDelay(slideObj, delay); } else {slider.play(); slider.flexAnimate(slider.getTarget('next')); } }, delay); } } }); $(document).trigger('metaslider/initialized', '#metaslider_21'); }; jQuery(document).ready(function($) { $('.metaslider').attr('tabindex', '0'); $(document).on('keyup.slider', function(e) { }); }); var timer_metaslider_21 = function() { var slider = !window.jQuery ? window.setTimeout(timer_metaslider_21, 100) : !jQuery.isReady ? window.setTimeout(timer_metaslider_21, 1) : metaslider_21(window.jQuery); }; timer_metaslider_21();/* ]]> */