diff options
author | ageier <andreas.geier@holidaycheck.com> | 2012-10-11 19:13:18 +0200 |
---|---|---|
committer | ageier <andreas.geier@holidaycheck.com> | 2012-10-11 19:18:17 +0200 |
commit | f6bae66089c71f0be8c9b9b2ec4091557af94e8d (patch) | |
tree | 7891cdf945d41bed1498f499675ce03f6cad03ff /js/reveal.js | |
parent | 4dad42496eaca9f2c2b46157e42574e80447b525 (diff) | |
download | perl-software-in-gnu-guix-f6bae66089c71f0be8c9b9b2ec4091557af94e8d.tar perl-software-in-gnu-guix-f6bae66089c71f0be8c9b9b2ec4091557af94e8d.tar.gz |
Make it possible to customize autoSlide for each slide
Diffstat (limited to 'js/reveal.js')
-rw-r--r-- | js/reveal.js | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/js/reveal.js b/js/reveal.js index c9ba7b1..9293337 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -33,7 +33,8 @@ var Reveal = (function(){ loop: false, // Number of milliseconds between automatically proceeding to the - // next slide, disabled when set to 0 + // next slide, disabled when set to 0, this value can be overwritten + // by using a data-autoSlide attribute on your slides autoSlide: 0, // Enable slide navigation via mouse wheel @@ -52,6 +53,10 @@ var Reveal = (function(){ dependencies: [] }, + // stores if the next slide should be shown automatically + // after n milliseconds + autoSlide = config.autoSlide, + // The horizontal and verical index of the currently active slide indexh = 0, indexv = 0, @@ -100,7 +105,6 @@ var Reveal = (function(){ threshold: 40 }; - /** * Starts up the presentation if the client is capable. */ @@ -780,7 +784,6 @@ var Reveal = (function(){ * bounds. */ function updateSlides( selector, index ) { - // Select all slides and convert the NodeList result to // an array var slides = Array.prototype.slice.call( document.querySelectorAll( selector ) ), @@ -841,6 +844,16 @@ var Reveal = (function(){ if( slideState ) { state = state.concat( slideState.split( ' ' ) ); } + + // if this slide has a autoSlide attribtue associated use this as autoSlide value + // otherwise use the global configured time + var slideAutoSlide = slides[index].getAttribute( 'data-autoslide' ); + if( slideAutoSlide ) { + autoSlide = parseInt(slideAutoSlide); + } else { + autoSlide = config.autoSlide + } + } else { // Since there are no slides we can't be anywhere beyond the @@ -1111,8 +1124,8 @@ var Reveal = (function(){ clearTimeout( autoSlideTimeout ); // Cue the next auto-slide if enabled - if( config.autoSlide ) { - autoSlideTimeout = setTimeout( navigateNext, config.autoSlide ); + if( autoSlide ) { + autoSlideTimeout = setTimeout( navigateNext, autoSlide ); } } |