Fading elements in and out without changing the layout of the page
The normal behavior when using fadeIn
and fadeOut
is to use the display
property. However, this changes the layout of the page.
How can I make fadeIn
and fadeOut
not modify the layout of the page?
Also
instead of .fadeIn()
you can .animate({opacity:1})
and instead of .fadeOut()
you can .animate({opacity:0})
You can try this for fadeOut
:
$("something here").fadeOut("slow", function() {
$(this).show().css({visibility: "hidden"});
});
...and this for fadeIn
:
$("something here").hide().css({visibility: "visible"}).fadeIn("slow");