jlmakes / scrollreveal

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

Reveal elements when scrolling horizontally, possible? #529

Closed greenm1nd3d closed 3 years ago

greenm1nd3d commented 3 years ago

I have a 1000px wide container, "with overflow: hidden". Inside the container, I have a UL with 4 LI, and each list item is 500px wide. Each list item has pictures and text in it. If I scroll from left to right (or vise versa), I want each LI (and its contents) to be revealed as they enter the view. I can only make scrollreveal work for vertical scrolling, but not horizontal scrolling.

jlmakes commented 3 years ago

You must change the options.container to the 1000px wide container element you're scrolling (instead of the body). After doing so you should have no problem revealing elements scrolling horizontally.