Skip to content

Commit

Permalink
add mobileViewDistance to readme #2513
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimel committed Dec 9, 2019
1 parent 1515ddc commit 94de806
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'"

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

0 comments on commit 94de806

Please sign in to comment.