[jQuery] Re: Problem with animate after submit in opera

2009-10-20 Thread Constantin Valeriu Tuguran
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"}, 6)
   .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 

>
> 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
>
>


[jQuery] Re: Problem with animate after submit in opera

2009-10-20 Thread Constantin Valeriu Tuguran

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.

Best Regards,

2009/10/20, Karl Swedberg :
> Is the link's href set to another page? If so, I'm surprised it works
> in any browser. You would need to return false after your animate
> methods:
>
>  $(document).ready(function(){
> $(".action").click(function(){
> $("#panel")
> .animate({top:"0px"}, 500)
>   .animate({top:"0"}, 4000)
>   .animate({top:"-75px"}, 500);
>   return false; // <-- prevent the link from being followed.
> });
>$("#panel").click(function(){
> $("#panel").hide();
> });
> });
>
>
> --Karl
>
> 
> Karl Swedberg
> www.englishrules.com
> www.learningjquery.com
>
>
>
>
> On Oct 19, 2009, at 8:55 AM, Vali wrote:
>
>>
>> Hello,
>>
>> Recently I encountered a problem in Opera: The browser does not run
>> any javascript after a page is submitted.
>> For example if you use animate on an anchor when you click on that
>> anchor the animate is never run unless the href is set to "#".
>>
>> This is the code:
>>
>> http://ajax.googleapis.com/ajax/
>> libs/jquery/1.3.2/jquery.js">
>> 
>>
>> $(document).ready(function(){
>>$(".action").click(function(){
>>$("#panel")
>>.animate({top:"0px"}, 500)
>>  .animate({top:"0"}, 4000)
>>  .animate({top:"-75px"}, 500);
>>});
>>   $("#panel").click(function(){
>>$("#panel").hide();
>>});
>>});
>>
>> 
>>
>>
>> 
>> body {
>>  margin: 0;
>>  padding: 0;
>>  font: 75%/120% Arial, Helvetica, sans-serif;
>>  background: #323232;
>> }
>> #panel {
>>  background: #eaeaea;
>>  height: 75px;
>>  width: 100%;
>>  position: absolute;
>>  top:-75px;
>> }
>> .action
>> {
>>  padding: 2px;
>>  color: white;
>>  margin: 0 auto ;
>>  background: #77;
>>  padding:  5px;
>>  border:2px solid #323232;
>> }
>>
>> 
>> 
>>
>> 
>>
>> 
>>  Your profile customization has been saved.
>> 
>>
>> 
>>
>> Save
>> bla bla
>>
>> 
>> 
>> 
>
>