浏览代码

check for 0 division, stops parallax failing if only the single horizontal slide and multiple vertical

Mike Mellor 9 年之前
父节点
当前提交
3e42929f90
共有 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;