diff --git a/README.md b/README.md index 7091f9bd..d069dd92 100644 --- a/README.md +++ b/README.md @@ -845,6 +845,11 @@ Reveal.addEventListener( 'somestate', function() { }, false ); ``` +### Slide Visibility +When preparing a presentation it can sometimes be helpful to prepare optional slides that you may or may not have time to show. This is easily done by appending a few slides at the end of the presentation, however this means that the reveal.js progress bar and slide numbering will hint that there are additional slides. + +To "hide" those slides from reveal.js' numbering system you can add a `data-visibility` attribute to the slide like so `
`. + ### Slide Backgrounds Slides are contained within a limited portion of the screen by default to allow them to fit any display and scale uniformly. You can apply full page backgrounds outside of the slide area by adding a `data-background` attribute to your `
` elements. Four different types of backgrounds are supported: color, image, video and iframe. diff --git a/js/reveal.js b/js/reveal.js index ce3e8a1c..26735390 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -4856,7 +4856,10 @@ break mainLoop; } - pastCount++; + // Don't count slides with the "uncounted" class + if( verticalSlides[j].dataset.visibility !== 'uncounted' ) { + pastCount++; + } } @@ -4865,8 +4868,9 @@ break; } - // Don't count the wrapping section for vertical slides - if( horizontalSlide.classList.contains( 'stack' ) === false ) { + // Don't count the wrapping section for vertical slides and + // slides marked as uncounted + if( horizontalSlide.classList.contains( 'stack' ) === false && !horizontalSlide.dataset.visibility !== 'uncounted' ) { pastCount++; } @@ -5078,7 +5082,7 @@ */ function getSlides() { - return toArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR + ':not(.stack)' ) ); + return toArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR + ':not(.stack):not([data-visibility="uncounted"])' ) ); }