Skip to content
This repository has been archived by the owner on Sep 13, 2021. It is now read-only.

Commit

Permalink
Merge pull request hakimel#1437 from der-michik/autoslide-direction
Browse files Browse the repository at this point in the history
Add an option to auto-slide right only
  • Loading branch information
hakimel committed Nov 19, 2015
2 parents d4152a2 + 0e7c9e5 commit e5afa80
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down Expand Up @@ -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.


Expand Down
9 changes: 4 additions & 5 deletions js/reveal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down Expand Up @@ -3834,10 +3837,6 @@
}
}

// If auto-sliding is enabled we need to cue up
// another timeout
cueAutoSlide();

}

/**
Expand Down

0 comments on commit e5afa80

Please sign in to comment.