summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHakim El Hattab2019-12-09 21:05:41 +0100
committerHakim El Hattab2019-12-09 21:05:41 +0100
commit94de806f06a3f8e349b77c865fcaf674f8aab06b (patch)
tree589deb6d96f3ad4417ea44b14a2e0cff4b1570c7
parent1515ddcf87076e2ce123c8d8cad415c5f8c0e85d (diff)
add mobileViewDistance to readme #2513
-rw-r--r--README.md5
-rw-r--r--js/reveal.js8
2 files changed, 10 insertions, 3 deletions
diff --git a/README.md b/README.md
index 3be68fb..55dbf8a 100644
--- a/README.md
+++ b/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'"
diff --git a/js/reveal.js b/js/reveal.js
index 75e3c68..57fe29d 100644
--- a/js/reveal.js
+++ b/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;
}