I have a div with an overflow set to hide elements.
<div style="overflow:hidden; height:40px">
<div class="item">Item 1</div>
<div class="item">Item 2</div>
<div class="item">Item 3</div>
</div>
Is it possible in jquery to detect if the first item is visible or hidden? Is it possible to detect the same for the last item?
use jQuery’s
.positionto figure out if the offset of the element from the parent is greater than the height of the parent.Code sample here