$('[data-uk-scrollspy]').on({ 'uk.scrollspy.inview', function(){ console.log("Element is visible."); }, 'uk.scrollspy.outview', function(){ console.log("Element is not visible."); } });