I have a bunch of elements hidden due to having overflow:hidden on the parent element. I made a jQuery function that adds to the margin to make a new set of elements visible when a user clicks. However, I need a way to detect when the last element is visible so I can stop this feature from working once the end is reached.
The function I was using is this:
$(this).children('.Product').last().is(':visible')
I also tried:
$(this).children('.Product:last-child').is(':visible')
Both return false even when the last .Product element is visible on the screen.
Should this be working? Is there a better way that I could be doing this?