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

Reply via email to