I have a jquery scroll function as below :
$(window).scroll(function() { if (($(window).scrollTop() + $(window).height()) >= ($('body').height() * 0.7)) { alert('call me'); } }); And the HTML:
<div style="height:450px;">BOX</div> When I scroll, instead of just one call me I am getting multiple times call me. Why so and whats wrong ? JSFiddle Example Here