Hmm the idea is in principle right.. BUT
I want to see the current content fade. See as long as the content is
exchanged nothing, and then have it come up.

Now tell me how to do that with you approach. If I fade first and then let
the updater run, I can not be sure in which state the fading currently is
when it completes. So it might be that the content is replaced while it is
fading.
Or if the Ajax stuff takes ages: the old content is gone, but no new there.
We see a blank screen until ajax completes.

These three things have to run in sequence to give the expected result.

Fabian

PS: my IE 7 seems not be able to alpha-filter-fade a <div> that contains a
<ul>....


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of jaimz
Sent: Mittwoch, 19. Juli 2006 00:20
To: rails-spinoffs@lists.rubyonrails.org
Subject: Re: [Rails-spinoffs] script.aculo.us effect to update elements

here's an idea!..

instead of programming as if it were BASIC...

dothis1
dothis2
dothis3

why don't you make it fade, then run the updater, then put the appear effect
on the onSuccess event of the updater..

seems quite logical to me.

-Jaimz
-----Original message-----
From: "Fabian Lange" [EMAIL PROTECTED]
Date: Tue, 18 Jul 2006 16:46:07 -0400
To: rails-spinoffs@lists.rubyonrails.org
Subject: [Rails-spinoffs] script.aculo.us effect to update elements

> Hi,
> perhaps I am overseeing this but it seems that there is no easy way to set
> up a queue with two effects (fade and appear) and in between exchange the
> content.
> So I have an application with static layout and just want to animate the
> exchange of the content from the main div.
> 
> So I wrote my own effect. The nice thing is that this is now queue able.
> 
> Effect.Updater = Class.create();
> Object.extend(Object.extend(Effect.Updater.prototype,
> Effect.Base.prototype), {
>   initialize: function(element) {
>     this.element = $(element);
>     var options = Object.extend({
>       duration: 0.001,
>       newContent: ''
>     }, arguments[1] || {});
>     this.start(options);
>   },
>   loop: function(timePos) {
>     if(timePos >= this.startOn) {
>       Element.update(this.element,this.options.newContent);
>       this.cancel();
>       return;
>     }
>   }
> });
> 
> So I can now put this to the method I pass to onComplete of Ajax.Request
> 
> function reload_content(ajax){
>   el = $('content');
>   new Effect.Fade(el,{queue:'front'});
>   new Effect.Updater(el,{newContent:ajax.responseText,queue:'end'});
>   new Effect.Appear(el,{queue:'end'});
> }
> 
> Is there a better way to accomplish this? If not, then I might contribute
> this when I figure out how the version control system works :)
> 
> 
> Br
> Fabian
> 
> _______________________________________________
> Rails-spinoffs mailing list
> Rails-spinoffs@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to