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()

jsfiddle


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

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -