I know it seems silly to make the ajax wait for the animation, but for some
reason, the animation seems a bit wonky in Internet Explorer if the ajax
link has been clicked previously. It seems like Internet Explorer checks
it's cache to see if it has a copy of the ajax request already, which means
it shows it straight away without any delay.

Here's the site I'm working on: http://34r34r.dreamhosters.com/
(It's just a personal wordpress theme).


malsup wrote:
> 
> Your second attempt looks the closest.  I would try it like this:
> 
> $('.ajax-div-slide').click(function() {
>     var url = this.href;
>     $('#ajax-loader').animate({height: 375}, 'slow', function(){
>         $('#ajax-div').load(url);
>     });
>     return false;
> });
> 
> But I've got to ask...  why do you want to delay an operation that
> already has inherent latency, just so that you can show an animation?
> Don't you want to show the ajax-loader *while* the ajax request is
> active?
> 
> 
> 
> 
> 
> 
> On 3/16/07, Yansky <[EMAIL PROTECTED]> wrote:
>>
>> How can I get an ajax request (that is triggered by a click event) wait
>> for
>> an animation to complete (which is also triggered by the same click
>> event)
>> before it runs the ajax request?
>>
>> e.g. this is what I'd like to do:
>>
>> $('.ajax-div-slide').click(function (){
>>    $('#ajax-div').ajaxSend(function(){
>>         $('#ajax-loader').animate({height: 375}, 2000);
>>    });
>>    //only start the ajax once the animation has finished
>>    $('#ajax-div').load(this.href);
>>    return false;
>>   });
>>
>> As well as the above example, I've also tried:
>>
>> $('.ajax-div-slide').click(function(){
>>         var passClick = $(this)
>>         $('#ajax-loader').animate({height: 375}, 'slow',
>> function(passClick){
>>         $('#ajax-div').load(passClick.href);
>>         });
>>         return false;
>> });
>>
>> ...and...
>>
>> $('.ajax-div-slide').click(function (){
>>    $this($('#ajax-loader').animate({height: 375}, 2000, function(){
>>    $('#ajax-div').load(this.href);
>>    });
>>    );
>>    return false;
>> });
>>
>> ...without any success.
>>
>> Anyone have any ideas as to how I can achieve this?
>>
>> Cheers.
>> --
>> View this message in context:
>> http://www.nabble.com/Event-%3EAJAX-wait-before-animation-completes-tf3412929.html#a9509661
>> Sent from the JQuery mailing list archive at Nabble.com.
>>
>>
>> _______________________________________________
>> jQuery mailing list
>> [email protected]
>> http://jquery.com/discuss/
>>
> 
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Event-%3EAJAX-wait-before-animation-completes-tf3412929.html#a9521300
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to