How to fade to display: inline-block

Boris Callens picture Boris Callens · Jul 7, 2009 · Viewed 72.4k times · Source

In my page I have a bunch (about 30) dom nodes that should be added invisible, and fade in when they are fully loaded.
The elements need a display: inline-block style.

I would like to use the jquery .fadeIn() function. This requires that the element initially has a display: none; rule to initially hide it. After the fadeIn() the elements off course have the default display: inherit;

How can I use the fade functionality with a display value other than inherit?

Answer

MakuraYami picture MakuraYami · Apr 25, 2012

$("div").fadeIn().css("display","inline-block");