Search code examples
jquerycssfadein

JQuery: hiding and then showing


Right now what I have works but it worries me because I don't think it should.

CSS:

#logo {
    display:none;
}

JQuery:

$("#logo").delay(800).fadeIn(800);

This setup works but when exposing the logo with JQuery, shouldn't JQuery alter the CSS? Does the JQuery fadeIn command automatically change display:none to display:inline/initial/block/etc?


Solution

  • Yes jQuery assigns an inline display:block to block elements and display:inline to inline elements when using fadeIn, fadeOut, and the misc slide functions. That is why it works.