From 1c16148c09e96742bd4cb728589654ed43103867 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Sun, 9 Jun 2013 17:15:40 +0200 Subject: set 'hidden' attribute on all slides except the present (#457) --- js/reveal.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'js/reveal.js') diff --git a/js/reveal.js b/js/reveal.js index f1ede50..7f0223f 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -1362,6 +1362,9 @@ var Reveal = (function(){ element.classList.remove( 'present' ); element.classList.remove( 'future' ); + // http://www.w3.org/html/wg/drafts/html/master/editing.html#the-hidden-attribute + element.setAttribute( 'hidden', '' ); + if( i < index ) { // Any element previous to index is given the 'past' class element.classList.add( reverse ? 'future' : 'past' ); @@ -1379,6 +1382,7 @@ var Reveal = (function(){ // Mark the current slide as present slides[index].classList.add( 'present' ); + slides[index].removeAttribute( 'hidden' ); // If this slide has a state associated with it, add it // onto the current state of the deck -- cgit v1.2.3