jQuery functions that take some time to run (animate, load, ajax) always
accept an optional final parameter (a callback) to be executed when it's
done. Also the context (thisArg) is always the original element. So, in your
case:

$("#link").click(function(){
  $("#contentbox").animate({width: "550px"}, 300, function() {
    $(this).load("interactive.html");
  });
});

- Richard

Richard D. Worth
http://rdworth.org/

On Sat, Jun 28, 2008 at 3:17 AM, Jason <[EMAIL PROTECTED]> wrote:

>
> Hello!
>
> Here is my setup: I want to click my link, have the content box
> animate to the proper width, and then have my HTML page appear once
> the animation is completed. In the snipped below, the content of the
> HTML pages loads before the animation is complete. How do I make this
> work?
>
>
>   $("#link").click(function(){
>      $("#contentbox").animate({width: "550px"}, 300 );
>          $("#contentbox").load("interactive.html");
>    });
>
>
> Thanks,
> Jason
>

Reply via email to