diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2012-10-13 11:44:54 -0400 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2012-10-13 11:44:54 -0400 |
commit | ed1db1f3c871c1bf85085973c49b361ab420bf46 (patch) | |
tree | ca22bc8024dc89ab4d021fcb5e5331264ed0356a /js | |
parent | 6619bc62bdde24bf79769c5ed63ac931e127d7f6 (diff) | |
parent | f6bae66089c71f0be8c9b9b2ec4091557af94e8d (diff) | |
download | freenode-live-2017-presentation-ed1db1f3c871c1bf85085973c49b361ab420bf46.tar freenode-live-2017-presentation-ed1db1f3c871c1bf85085973c49b361ab420bf46.tar.gz |
Merge branch 'master' of https://github.com/functino/reveal.js
Diffstat (limited to '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 8b19c46..56f5578 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 ); } } |