Thanks again for your time.
The idea is this: I have an action that usually finishes instantly but can
take alot of time if on that action the database is migrated (this happens
rarely but it happens).
On this action i triggered the animation because I wanted to notify the user
somehow that things are happening in the background.
Actually in my code I added a delay function and it looks like this:

 $("#panel").delay(3000)
               .animate({top:"0px"}, 500)
                 .animate({top:"0"}, 60000)
               .animate({top:"-75px"}, 500);

So if the action takes more than 3 seconds it must be database migration so
the panel is shown.


2009/10/20 Karl Swedberg <k...@englishrules.com>

>
> On Oct 20, 2009, at 3:53 AM, Constantin Valeriu Tuguran wrote:
>
> Thanks for the help.
> I wanted to give the user some feedback while waiting for an action to
> complete so I can not return false.
> I must find another way.
>
>
> How about this, then? ...
>
>         $(document).ready(function(){
>            $(".action").click(function(){
> var thisHref = this.href;
> $("#panel")
> .animate({top:"0px"}, 500)
>  .animate({top:"0"}, 4000)
>  .animate({top:"-75px"}, 500, function() {
> window.location = thisHref; // <-- follow the link after the last animation
> finishes.
> });
>  return false; // <-- prevent the link from being followed before
> animations.
>            });
>      $("#panel").click(function(){
>                $("#panel").hide();
>            });
>        });
>
>
>
> --Karl
>
> ____________
> Karl Swedberg
> www.englishrules.com
> www.learningjquery.com
>
>

Reply via email to