Fixes bad NaN applied to style on updateParallax.
The previous criteria "verticalSlideCount > 0" would result in verticalOffset being NaN when verticalSlideCount == 1. This would cause dom.background.style.backgroundPosition to be set to something like "123px NaNpx", ultimately preventing the parallax effect to play (silently failing so far).
This commit is contained in:
parent
8b8cc607d4
commit
d9513b34d5
1 changed files with 1 additions and 1 deletions
|
@ -2032,7 +2032,7 @@ var Reveal = (function(){
|
|||
|
||||
var slideHeight = dom.background.offsetHeight;
|
||||
var verticalSlideCount = verticalSlides.length;
|
||||
var verticalOffset = verticalSlideCount > 0 ? -( backgroundHeight - slideHeight ) / ( verticalSlideCount-1 ) * indexv : 0;
|
||||
var verticalOffset = verticalSlideCount > 1 ? -( backgroundHeight - slideHeight ) / ( verticalSlideCount-1 ) * indexv : 0;
|
||||
|
||||
dom.background.style.backgroundPosition = horizontalOffset + 'px ' + verticalOffset + 'px';
|
||||
|
||||
|
|
Loading…
Reference in a new issue