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,858
  • 2
  • 15
  • 26

1 Answers1

2

Try this:

$(document).scroll(function(){
    if($(document).scrollTop() + $(window).height() > $("your div").offset().top){
        // start your animation
    }
});
frogatto
  • 27,475
  • 10
  • 76
  • 119