views:

63

answers:

3

Hi,

I know this doesn't work:

$('#section').html($(data), function() { $('#section').fadeIn(); });

How would I go on writing it? It should be simply, but I've been away from jQuery for too long. Thanks!

+2  A: 

Do you want to call fadeIn after the html method is completed? You can simply do this,

$('#section')
    .html($(data))
    .fadeIn();

Above works because unlike the 'animate' methods, html method is synchronous. fadeIn method will be called only after html method has finished executing.

SolutionYogi
+1 - 20 seconds!
John Rasch
+1  A: 

If you want the section to fade in after you set its innerHTML, this is what you need:

$('#section').html($(data)).fadeIn();
John Rasch
A: 

Are you talking about using the document ready function to fade something once it's ready?

Anything you would need to know is right in their Documentation. Since you didn't really ask a specific question, and you said you're familiar with it, it won't take much to figure out what you want to do.

Sneakyness