jlmakes / scrollreveal

Animate elements as they scroll into view.
https://scrollrevealjs.org/
22.3k stars 2.26k forks source link

Scroll reveal targets not triggered in accordian when opened #507

Closed caseyzman closed 4 years ago

caseyzman commented 4 years ago

https://jsfiddle.net/oqhjayck/

Reveal targets are not triggered when they are inside of accordians, tabs, etc when their respective accordion is opened. See fiddle example above.

Note: if the specific accordion is clicked/opened, and then the window is resized, those targets will now animate.

Environment

jlmakes commented 4 years ago

The primary event handler is ScrollReveal().delegate(), which is invoked on scroll and resize events. That's the function that checks for changes in element visibility, triggers animations, etc. You normally don't need to manually invoke this function, but in your case, it would make sense to do so inside your accordion click handler.

tremby commented 2 years ago

I need the same thing, but I don't really want to rely on an undocumented function, since that tends to lead to trouble down the road. I wonder if you'd be willing to make that function public (i.e. document it), or an equivalent? Or am I better off triggering a fake "scroll" event SR will pick up?