我需要在用戶滾動幾乎在頁面的底部,然後直到某個點後專門觸發一個函數。我如何正確地做到這一點?複雜的jquery scoll
advertisement.refreshAd = function() {
$(window).scroll(function(event) {
if('almost at the end then scroll up to certain point')
{console.log('trigger refresh!');}
});
}