From bfadfcc7ce8235ad90982aa5020731db9b2ee69c Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Tue, 4 Jun 2013 19:51:06 +0200 Subject: don't transition to first slide background (#453) --- js/reveal.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'js/reveal.js') diff --git a/js/reveal.js b/js/reveal.js index 7d8020f..edad911 100644 --- a/js/reveal.js +++ b/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 ); + } /** -- cgit v1.2.3