Carousel fixes.
[wolnelektury.git] / src / wolnelektury / static / js / base.js
index 439ba13..2d0ebbf 100644 (file)
         });
 
 
+        $('.carousel').on('cycle-before', function(event, optionHash, outgoingSlideEl, incomingSlideEl, forwardFlag) {
+            $("iframe", outgoingSlideEl).attr("src", '');
+            $("iframe", incomingSlideEl).attr("src", $("iframe", incomingSlideEl).attr('data-src'));
+        });
+        $('.carousel section').first().each(function() {
+            $("iframe", this).attr("src", $("iframe", this).attr('data-src'));
+        });
+
 
         (function() {
             var $current = null;