vvo / in-viewport

Get a callback when any element becomes visible in a viewport (body or custom viewport)
MIT License
276 stars 24 forks source link

does not work with two elements #12

Closed bwanaaa closed 7 years ago

bwanaaa commented 9 years ago

I have an audio player that plays different songs depending on what's in the viewport. Here's a codepen:

http://codepen.io/littleredbowtie/pen/OyLMNq

It starts properly and switches to the the second song properly. But when I scroll back up to the top, it does not switch back to the first song.

Where's my error please?

Stefan

vvo commented 9 years ago

I don't know, can you do a simpler example without any song, audio etc? Just two elements and getting callbacks, then we can see what's wrong

tzi commented 7 years ago

We are here to help, but I will close this issue without further informations.

Cheers, Thomas.