Is there a way to create a script that can show and hide a span based on the scrolling position of a div?
$("span").hide();
$(".box").scroll(function() {
if (/* <div> scolling is euqal or less than 10px away from bottom: */){
$("span").show();
} else {
$("span").hide();
}
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.0/jquery.min.js"></script>
<div class="box" style="overflow: auto; height:100px">
<p>a</p>
<p>a</p>
<p>a</p>
<p>a</p>
<p>a</p>
<p>a</p>
<p>a</p>
<p>a</p>
</div>
<span>Reached bottom</span>