0

I need to do some actions when the div comes in the display area of the browser with jquery.

I gave some animation to the DIV, it is in the bottom of the webpage. But that animation need to start when the user scroll and reach that position.

Arun Krishnan
  • 1,898
  • 3
  • 16
  • 28

1 Answers1

2

Try this:

$(document).scroll(function(){
    if($(document).scrollTop() + $(window).height() > $("your div").offset().top){
        // start your animation
    }
});
frogatto
  • 28,539
  • 11
  • 83
  • 129