Parcourir la source

add mobileViewDistance to readme #2513

Hakim El Hattab il y a 5 ans
Parent
commit
94de806f06
2 fichiers modifiés avec 10 ajouts et 3 suppressions
  1. 5 0
      README.md
  2. 5 3
      js/reveal.js

+ 5 - 0
README.md

@@ -382,6 +382,11 @@ Reveal.initialize({
 	// Number of slides away from the current that are visible
 	viewDistance: 3,
 
+	// Number of slides away from the current that are visible on mobile
+	// devices. It is advisable to set this to a lower number than
+	// viewDistance in order to save resources.
+	mobileViewDistance: 2,
+
 	// Parallax background image
 	parallaxBackgroundImage: '', // e.g. "'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'"
 

+ 5 - 3
js/reveal.js

@@ -270,8 +270,9 @@
 			// Number of slides away from the current that are visible
 			viewDistance: 3,
 
-			// Number of slides away from the current that are visible on mobile devices
-			// It is advisable to set this to a lower number than viewDistance in order to save resources
+			// Number of slides away from the current that are visible on mobile
+			// devices. It is advisable to set this to a lower number than
+			// viewDistance in order to save resources.
 			mobileViewDistance: 2,
 
 			// The display mode that will be used to show slides
@@ -3288,7 +3289,8 @@
 			// be visible
 			var viewDistance = isOverview() ? 10 : config.viewDistance;
 
-			// Limit view distance on weaker devices
+			// Shorten the view distance on devices that typically have
+			// less resources
 			if( isMobileDevice ) {
 				viewDistance = isOverview() ? 6 : config.mobileViewDistance;
 			}