I’m looking for a way to reposition elements on the bottom-right of the viewport once the elements are scrolled out of the viewport from their original position.
I can’t find an example at the moment, but this is common with video ads and also blog posts that have embedded video/audio players.
For example, suppose I have an embedded Youtube Video/Soundcloud. It’s positioned by default at the top of the page. But, once the the user scrolls down the viewport, after the media player element is
I’m a noobie, but the best thing I can come up with is to pass the height of the media player and then add the scroll listener to position:fixed the media player element once they’ve scrolled down enough.
What’s the best way to tackle this?