瀏覽代碼

Add mobileViewDistance config key

Tuur Dutoit 5 年之前
父節點
當前提交
6ab72eae51
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      js/reveal.js

+ 5 - 1
js/reveal.js

@@ -270,6 +270,10 @@
 			// 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,
+
 			// The display mode that will be used to show slides
 			display: 'block',
 
@@ -3257,7 +3261,7 @@
 
 			// Limit view distance on weaker devices
 			if( isMobileDevice ) {
-				viewDistance = isOverview() ? 6 : 2;
+				viewDistance = isOverview() ? 6 : config.mobileViewDistance;
 			}
 
 			// All slides need to be visible when exporting to PDF