frankyonnetti
5/6/2016 - 7:01 PM

#jquery div has reached top of page.

jQuery - div has reached top of page #jquery

var distance = $('div').offset().top
    $window = $(window)

$window.scroll(function () {
  if ( $window.scrollTop() >= distance ) {
    // Your div has reached the top
    console.log('Your div has reached the top')
  }
})