diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2015-11-19 15:30:35 +0100 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2015-11-19 15:30:35 +0100 |
commit | bbe38ad2639ae483c16312f0b1594cfdea6d2a06 (patch) | |
tree | f23dfc11bf8ba14ac84d1100def708a5aaab8526 | |
parent | 833622edcd45a7721f7a76d93cc12a1284f60a0d (diff) | |
parent | a398a02edb19ad73d0bebcd5c3bd5334bc05ff3d (diff) | |
download | fosdem-2018-presentation-bbe38ad2639ae483c16312f0b1594cfdea6d2a06.tar fosdem-2018-presentation-bbe38ad2639ae483c16312f0b1594cfdea6d2a06.tar.gz |
Merge pull request #1437 from der-michik/autoslide-direction
Add an option to auto-slide right only
-rw-r--r-- | README.md | 5 | ||||
-rw-r--r-- | js/reveal.js | 9 |
2 files changed, 9 insertions, 5 deletions
@@ -152,6 +152,9 @@ Reveal.initialize({ // Stop auto-sliding after user input autoSlideStoppable: true, + // Use this method for navigation when auto-sliding + autoSlideMethod: Reveal.navigateNext, + // Enable slide navigation via mouse wheel mouseWheel: false, @@ -297,6 +300,8 @@ You can also override the slide duration for individual slides and fragments by </section> ``` +To override the method used for navigation when auto-sliding, you can specify the ```autoSlideMethod``` setting. To only navigate along the top layer and ignore vertical slides, set this to ```Reveal.navigateRight```. + Whenever the auto-slide mode is resumed or paused the ```autoslideresumed``` and ```autoslidepaused``` events are fired. diff --git a/js/reveal.js b/js/reveal.js index d2b2970..46a6295 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -3688,7 +3688,10 @@ // - The overview isn't active // - The presentation isn't over if( autoSlide && !autoSlidePaused && !isPaused() && !isOverview() && ( !Reveal.isLastSlide() || availableFragments().next || config.loop === true ) ) { - autoSlideTimeout = setTimeout( navigateNext, autoSlide ); + autoSlideTimeout = setTimeout( function() { + typeof config.autoSlideMethod === 'function' ? config.autoSlideMethod() : navigateNext(); + cueAutoSlide(); + }, autoSlide ); autoSlideStartTime = Date.now(); } @@ -3834,10 +3837,6 @@ } } - // If auto-sliding is enabled we need to cue up - // another timeout - cueAutoSlide(); - } /** |