fix issue where auto-animate did not work when jumping three or more slides (i.e. longer than the view distance)
This commit is contained in:
@ -50,11 +50,19 @@ export default class AutoAnimate {
|
||||
// Flag the navigation direction, needed for fragment buildup
|
||||
animationOptions.slideDirection = toSlideIndex > fromSlideIndex ? 'forward' : 'backward';
|
||||
|
||||
// If the from-slide is hidden because it has moved outside
|
||||
// the view distance, we need to temporarily show it while
|
||||
// measuring
|
||||
let fromSlideIsHidden = fromSlide.style.display === 'none';
|
||||
if( fromSlideIsHidden ) fromSlide.style.display = this.Reveal.getConfig().display;
|
||||
|
||||
// Inject our auto-animate styles for this transition
|
||||
let css = this.getAutoAnimatableElements( fromSlide, toSlide ).map( elements => {
|
||||
return this.autoAnimateElements( elements.from, elements.to, elements.options || {}, animationOptions, autoAnimateCounter++ );
|
||||
} );
|
||||
|
||||
if( fromSlideIsHidden ) fromSlide.style.display = 'none';
|
||||
|
||||
// Animate unmatched elements, if enabled
|
||||
if( toSlide.dataset.autoAnimateUnmatched !== 'false' && this.Reveal.getConfig().autoAnimateUnmatched === true ) {
|
||||
|
||||
|
Reference in New Issue
Block a user