I got a question regarding a function that will be called if the object is within my screen. But when the object is within my screen the function is been called and a alert
$(window).on('scroll', function() { if ($(document).scrollTop() >= $(document).height() / 100) { $("#spopup").show("slow"); $(window).off('scroll'); } else { $("#spopup").hide("slow"); } }); function closeSPopup() { $('#spopup').hide('slow'); }
worked for me