-2

I need a simple solution, to fire an event when user scroll the page to a certain div. i want to show that div which is currently collapsed.

A.J.
  • 8,557
  • 11
  • 61
  • 89

1 Answers1

2
$(window).scroll(function(event) {
    console.log($(".target").offset().top < $(window).scrollTop() + $(window).outerHeight());
});

Source: Other question

Community
  • 1
  • 1
Mathias Dewelde
  • 665
  • 9
  • 19