Browse Source

Merge branch 'dev' of github.com:hakimel/reveal.js into dev

Hakim El Hattab 9 years ago
parent
commit
0cd4e2c84f
2 changed files with 9 additions and 5 deletions
  1. 5 0
      README.md
  2. 4 5
      js/reveal.js

+ 5 - 0
README.md

@@ -152,6 +152,9 @@ Reveal.initialize({
 	// Stop auto-sliding after user input
 	// Stop auto-sliding after user input
 	autoSlideStoppable: true,
 	autoSlideStoppable: true,
 
 
+	// Use this method for navigation when auto-sliding
+	autoSlideMethod: Reveal.navigateNext,
+
 	// Enable slide navigation via mouse wheel
 	// Enable slide navigation via mouse wheel
 	mouseWheel: false,
 	mouseWheel: false,
 
 
@@ -297,6 +300,8 @@ You can also override the slide duration for individual slides and fragments by
 </section>
 </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.
 Whenever the auto-slide mode is resumed or paused the ```autoslideresumed``` and ```autoslidepaused``` events are fired.
 
 
 
 

+ 4 - 5
js/reveal.js

@@ -3688,7 +3688,10 @@
 			// - The overview isn't active
 			// - The overview isn't active
 			// - The presentation isn't over
 			// - The presentation isn't over
 			if( autoSlide && !autoSlidePaused && !isPaused() && !isOverview() && ( !Reveal.isLastSlide() || availableFragments().next || config.loop === true ) ) {
 			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();
 				autoSlideStartTime = Date.now();
 			}
 			}
 
 
@@ -3834,10 +3837,6 @@
 			}
 			}
 		}
 		}
 
 
-		// If auto-sliding is enabled we need to cue up
-		// another timeout
-		cueAutoSlide();
-
 	}
 	}
 
 
 	/**
 	/**