0

Hey everbody, im getting some trouble here.

Is jQuery capable to tell me when a div "appers" (not gets visible, i mean, when it not gets display block, it just appears on the screen) and give me an a alert?

I have to get an alert when my div reaches the screen.

Thanks for anything!

Lucas Veiga
  • 1,758
  • 7
  • 27
  • 45
  • 2
    possible duplicate of [jQuery(event): watch element style](http://stackoverflow.com/questions/4567987/jqueryevent-watch-element-style) – karim79 Jan 05 '11 at 03:25
  • 1
    I'm a little confused by your wording. It sounds like you may be defining "appears" as "when it appears as a result of scrolling the page". Is that right? – user113716 Jan 05 '11 at 04:02
  • Have a look http://stackoverflow.com/questions/3859034/jquery-how-to-bind-an-event-for-the-div-when-it-becomes-visible – NoWar Jan 16 '12 at 13:14

1 Answers1

0

Try putting the script tag for your alert within the div element. That way, the code will only be executed when the div is shown. If a browser blocks the div, the code won't run and you won't get your alert.

rjm
  • 16