I have a dynamic amount of div's being returned from a query, all with the class #li. I want them all to fade in smoothly instead of just appear. So far I'm using this code:
function loadTables() {
$.get("display.php", { server: Server, username: Username, password: Password, database: Database, content: "tables" },
function(data){
html = ''
$(data).find("table").each(function() {
html = html + "<div id='li'>" + $(this).text() + "</div>";
});
$('#content').html(html);
$('#li').hide();
$('#li').fadeIn('slow');
}
);
}
But the problem is, the animation only works on the first div. It animates in just fine. But all the rest just appear. The docs on jQuery.com say that it does this for all matching elements, but, it doesnt appear to be doing so. How can I fix this?