jquery fadeout, load, fadein

Posted by John on Stack Overflow See other posts from Stack Overflow or by John
Published on 2010-04-30T15:06:20Z Indexed on 2010/04/30 15:07 UTC
Read the original article Hit count: 339

Filed under:
|

Hi, I am using JQuery and what I want to happen is.

Div fades out using the fadeOut command. It then loads content from a url using the load command. Then once content loaded it fades back in using the fadeIn command.

The code I have is:

$("#myDiv").fadeOut().load('www.someurl.com').fadeIn()

However this does not work. It kind of flashes then loads out then loads in. I think the problem is that the fading is happening before the load is complete.

What should I do

Thanks

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-effects