DEV Community

Discussion on: Fade-in animation on scroll with IntersectionObserver(Vanilla JS)

Collapse
 
iwishyoucouldtalk profile image
Jason Reynolds

This is great – thank you.
Any idea how would stop it from repeating as you scroll back up the page (i.e. only fade-in once)?

Collapse
 
miacan2021 profile image
Shiho Kazama | mia

I added Sample 3 in the Code Pen. Please check it.
It just remove else part and add 'entry.unobserve(entry.target)'.
Thank you!

Collapse
 
iwishyoucouldtalk profile image
Jason Reynolds

Thanks so much <3