Closed seppeclijsters closed 5 years ago
Does it behave the same in all browsers?
What happens if you add ScrollReveal().delegate()
to the onEnterCompleted
callback?
I'm working locally at the moment and testing on chrome & safari.
I added ScrollReveal().delegate()
to the onEnterCompleted
and this did the trick! All animations are working like before. I'm a happy man now, thanks a lot @jlmakes !
I'm not really sure what ScrollReveal().delegate()
triggers but I'm glad it works.
Excellent!
The ScrollReveal().delegate()
function is the event handler ScrollReveal uses when responding to resize
or scroll
events; so, normally this function is called for you while scrolling or resizing, but it was made public in version 4 for circumstances just like this.
So in other words, we've forced a ScrollReveal update inside Barba.js’ onEnterComplete
callback.
Barba.js is a lbrary that helps you create fluid and smooth transitions between website pages. On the starting page all animations are working. But whenever I click a link to the next page, the scrollreveal animations won't activate on the new page (when I click on inspect element they suddenly work).
It all worked perfectly in an older version of scrollreveal. It seems like the scrollposition doesn't reset when going to a new page (with barba.js).
Here an example code. It's difficult to recreate this in codepen since it only stops working when opening a new link with barba.js.