jQuery Fade a div off the screen
In my app, I开发者_如何转开发 have a temporary div that is shown each time the app is saved (see markup below). I'm using jQuery 1.4.2 and would like to know the command that will fade this div off the screen after 3 seconds...
<script src="../wp-content/themes/mytheme/jquery-1.4.2.min.js" type="text/javascript"></script>
if ($_REQUEST['saved']) echo '<div id="message" class="updated fade"><p>'.$themename.' settings saved.</strong></p></div>';
jQuery's fadeOut() should do the job.
http://api.jquery.com/fadeOut/
$('#message').delay(3000).fadeOut();
精彩评论