I’m looking detect when a div with class ‘.selected’ is below the bottom of its container div (hidden by overflow:hidden). If it is, scroll down the contents of the container to reveal the next ‘page’, either by scrolling the equivalent of the container’s height or by scrolling until the ‘.selected’ is at the top of it’s container again.
What would be the best way to go about doing this?
I used
scrollToand some of the math from the link I posted in the comment to make this:bd=distance from top of container to selected item’s bottomch= content container height