Jay Salvat 10 gadi atpakaļ
vecāks
revīzija
10849556e2
5 mainītis faili ar 22 papildinājumiem un 9 dzēšanām
  1. 2 1
      dist/vegas.css
  2. 19 7
      dist/vegas.js
  3. 0 0
      dist/vegas.min.css
  4. 1 1
      dist/vegas.min.js
  5. 0 0
      dist/vegas.min.js.map

+ 2 - 1
dist/vegas.css

@@ -1,5 +1,6 @@
 .vegas-container {
     overflow: hidden !important;
+    position: relative;
 }
 
 .vegas-wrapper,
@@ -46,12 +47,12 @@
 
 body.vegas-container {
     overflow: auto;
+    position: static;
 }
     body.vegas-container > .vegas-timer,
     body.vegas-container > .vegas-overlay,
     body.vegas-container > .vegas-slide {
         position: fixed;
-        z-index: -1;
     }
 
 .vegas-video {

+ 19 - 7
dist/vegas.js

@@ -1,6 +1,6 @@
 /*!-----------------------------------------------------------------------------
  * Vegas - Fullscreen Backgrounds and Slideshows.
- * v2.0.0-wip - built 2015-01-15
+ * v2.0.0-wip - built 2015-01-16
  * Licensed under the MIT License.
  * http://vegas.jaysalvat.com/
  * ----------------------------------------------------------------------------
@@ -106,9 +106,14 @@
             // Preloading
             if (preload) {
                 for (i = 0; i < this.settings.slides.length; i++) {
-                    img = new Image();
-                    img.src = this.settings.slides[i].src;
+                    if (this.settings.slides[i].src) {
+                        img = new Image();
+                        img.src = this.settings.slides[i].src;
+                    }
                 }
+
+                // TODO: 
+                // Preload videos
             }
 
             // Wrapper with content
@@ -150,9 +155,6 @@
             // Container
             this.$elmt.addClass('vegas-container');
             if (!isBody) {
-                if (position === 'static') {
-                    this.$elmt.css('position', 'relative');
-                }
                 this.$elmt.append($wrapper);
             }
 
@@ -166,6 +168,7 @@
             if (this.paused || this.noshow) {
                 clearTimeout(this.timeout);
             } else {
+                clearTimeout(this.timeout);
                 this.timeout = setTimeout(function () {
                     self.next();
                 }, this._options('delay')); 
@@ -340,8 +343,17 @@
             }
 
             if (video) {
+                // oncanplay is triggered every time when loop=true
+                // so let's start the slide only once
+                var played = false; 
+
                 video.play();
-                video.oncanplay = go;
+                video.oncanplay = function () {
+                    if (!played) {
+                        played = true;
+                        go();
+                    }
+                };
             } else {
                 img.onload = go;
             }

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/vegas.min.css


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 1
dist/vegas.min.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/vegas.min.js.map


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels