How to detect if a div has scrolled to the bottom by using a button click function (not scroll arrow buttons)?
E.g.: So when $('#checkBottom').
is clicked, if $('#items')
has scrolled to the bottom of the div it outputs the alert. And when $('#checkBottom').
is clicked, if $('#items')
has not scrolled to the bottom of the div it dosen't output the alert.
Jq:
$('#checkBottom').on('click', function () {
alert("yes, it has reached the bottom of the scroll");
});
scroll div structure example:
<div id="Wrapper">
<div id="itemWrapper">
<div id="items">
<div class="content">
<input type="image" src="http://img42.com/p1puE+" />
</div>
<div class="content">
<input type="image" src="http://img42.com/p1puE+" />
</div>
<div class="content">
<input type="image" src="http://img42.com/p1puE+" />
</div>
</div>
</div>
</div>