Jelajahi Sumber

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

Mike Mellor 9 tahun lalu
induk
melakukan
3e42929f90
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  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;