浏览代码

Merge pull request #1434 from mikemellor11/master

stops parallax failing if only the single horizontal slide and multiple vertical
Hakim El Hattab 9 年之前
父节点
当前提交
31550d09e4
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      js/reveal.js

+ 1 - 1
js/reveal.js

@@ -2798,7 +2798,7 @@
 				horizontalOffsetMultiplier = config.parallaxBackgroundHorizontal;
 			}
 			else {
-				horizontalOffsetMultiplier = ( backgroundWidth - slideWidth ) / ( horizontalSlideCount-1 );
+				horizontalOffsetMultiplier = ( horizontalSlideCount-1  > 0) ? ( backgroundWidth - slideWidth ) / ( horizontalSlideCount-1 ) : 0;
 			}
 
 			horizontalOffset = horizontalOffsetMultiplier * indexh * -1;