Fade an element in on load with jQuery -
i'm trying fade in element in jquery , despite simplicity, isn't working me. here's code:
<table><tr><td>blah</td></tr></table> $(document).ready(function () { $("table").css('color','green'); $("table").fadein(2000); });
and here's example in jsfiddle: http://jsfiddle.net/heukn/1/
it won't fade in unless it's hidden first. try instead:
$(document).ready(function () { $("table").css('color','green'); $("table").hide().fadein(2000); });
here i've used hide()
you could, alternatively, not display using css:
table{display: none;}
the downfall being that, if user doesn't have javascript enabled (unlikely, know, possible) table never displayed.
Comments
Post a Comment