Answers for "jquery trigger event when scroll to div"

0

jquery trigger event when scroll to div

$(window).scroll(function() {
   var hT = $('#scroll-to').offset().top,
       hH = $('#scroll-to').outerHeight(),
       wH = $(window).height(),
       wS = $(this).scrollTop();
   if (wS > (hT+hH-wH)){
       console.log('H1 on the view!');
   }
});
Posted by: Guest on November-25-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language