Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fading elements in and out without changing the layout of the page

Tags:

jquery

css

layout

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?

like image 469
lars Avatar asked Feb 13 '10 03:02

lars


People also ask

What is fade in and fadeOut in animation?

In android, Fade In and Fade Out animations are used to change the appearance and behavior of the objects over a particular interval of time. The Fade In and Fade Out animations will provide a better look and feel for our applications.

What is Fade In in HTML?

The jQuery fadeIn() method is used to fade in a hidden element. Syntax: $(selector). fadeIn(speed,callback); The optional speed parameter specifies the duration of the effect.


1 Answers

Also

instead of .fadeIn() you can .animate({opacity:1})
and instead of .fadeOut() you can .animate({opacity:0})

like image 111
Gabriele Petrioli Avatar answered Oct 30 '22 06:10

Gabriele Petrioli