Parcourir la source

don't transition to first slide background (#453)

Hakim El Hattab il y a 11 ans
Parent
commit
bfadfcc7ce
4 fichiers modifiés avec 18 ajouts et 8 suppressions
  1. 7 6
      css/reveal.css
  2. 0 0
      css/reveal.min.css
  3. 10 1
      js/reveal.js
  4. 1 1
      js/reveal.min.js

+ 7 - 6
css/reveal.css

@@ -1245,12 +1245,13 @@ body {
 	left: 0;
 }
 
-.no-transition {
-	-webkit-transition: none;
-	   -moz-transition: none;
-	    -ms-transition: none;
-	     -o-transition: none;
-	        transition: none;
+.no-transition,
+.no-transition * {
+	-webkit-transition: none !important;
+	   -moz-transition: none !important;
+	    -ms-transition: none !important;
+	     -o-transition: none !important;
+	        transition: none !important;
 }
 
 

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
css/reveal.min.css


+ 10 - 1
js/reveal.js

@@ -252,6 +252,7 @@ var Reveal = (function(){
 
 		// Clear prior backgrounds
 		dom.background.innerHTML = '';
+		dom.background.classList.add( 'no-transition' );
 
 		// Helper method for creating a background element for the
 		// given slide
@@ -1463,10 +1464,13 @@ var Reveal = (function(){
 	}
 
 	/**
-	 * 
+	 * Updates the background elements to reflect the current 
+	 * slide.
 	 */
 	function updateBackground() {
 
+		// Update the classes of all backgrounds to match the 
+		// states of their slides (past/present/future)
 		toArray( dom.background.childNodes ).forEach( function( backgroundh, h ) {
 
 			backgroundh.className = ( h < indexh ? 'past' : h > indexh ? 'future' : 'present' );
@@ -1479,6 +1483,11 @@ var Reveal = (function(){
 
 		} );
 
+		// Allow the first background to apply without transition
+		setTimeout( function() {
+			dom.background.classList.remove( 'no-transition' );
+		}, 1 );
+
 	}
 
 	/**

Fichier diff supprimé car celui-ci est trop grand
+ 1 - 1
js/reveal.min.js


Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff