I do a fade in div that is not displayed when I load the page:
$('#overlay').fadeIn('fast'); $('#box').fadeIn('slow');
I would do this instructions after x seconds, doing a fadeOut of the div:
$('#overlay').fadeOut('fast'); $('#box').hide();
How can I do it? Actually fadeOut is done on button click.
The script is here: http://clouderize.it/cookie-localstorage/a.php The div that appear when I click on another image will disappear after x seconds. Thanks a lot.
The jQuery fadeOut() method is used to fade out a visible element. Syntax: $(selector). fadeOut(speed,callback);
jQuery Effect fadeOut() Method The fadeOut() method gradually changes the opacity, for selected elements, from visible to hidden (fading effect). Note: Hidden elements will not be displayed at all (no longer affects the layout of the page). Tip: This method is often used together with the fadeIn() method.
fadeOut() the place will be removed at once. . show(duration) and . hide(duration) animate the size of element (also the opacity) to 100% and 0% and the place of elements is also animated in that duration.
The fadeToggle() method toggles between the fadeIn() and fadeOut() methods. If the elements are faded out, fadeToggle() will fade them in. If the elements are faded in, fadeToggle() will fade them out.
The .delay
method is purpose built for what you are describing:
$('#overlay').fadeIn('fast').delay(1000).fadeOut('fast'); $('#box').fadeIn('slow').delay(1000).hide(0);
http://jsfiddle.net/SUBnz/1/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With