jQuery fadeout a div that's revealed by php and not Javascript?

Posted by songdogtech on Stack Overflow See other posts from Stack Overflow or by songdogtech
Published on 2010-04-27T23:24:43Z Indexed on 2010/04/27 23:33 UTC
Read the original article Hit count: 319

Filed under:
|
|

Seems like this might be easy, but from reading other SO answers there are a number of ways for it to possibly work:

I have the "thanks" div below that shows when a php form is sucessfully submitted:

<?php if(isset($emailSent) && $emailSent == true) { ?>
<div class="thanks"></div>

The page does not reload after the form is submitted; the php for the form is included in the page header, the php above is in <body>, and when the form is submitted, the "thanks" div appears.

Question: How can the div be faded out (or simply removed) after a few seconds?

Document ready doesn't seem like it would work because the page is not reloaded. Can jQuery detect the appearance of the div and then start the fadeout timer?

If possible, I'd like to stay with the php form and not move to a jQuery form.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about php