Yes I try to set 4.0 but it seems not to work

Here is what I do:

new Effect.Poof(msg, arrayOfImages, {
                              duration: 4.0,
                              afterFinish:  function(){ ... }
                            });

And the copy/past effect:

Effect.Poof = Class.create();
Object.extend(Object.extend(Effect.Poof.prototype,Effect.Base.prototype),{
  initialize: function(element,images) {
    var options = arguments[2] || {};

    // options
    if(!options.fps) options.fps = 15.0;
    if(!options.duration) options.duration = (1.0 / options.fps) *
images.length;


    // start at the first image
    this.current = 0;
    this.poofers = images;

    this.element = $(element);
    this.oldChild = this.element.firstChild;
    this.element.removeChild(this.element.firstChild);

    // ** I'd like to replaces these lines with a setOpacity
    this.oldBG = this.element.style.backgroundColor;
    this.element.style.backgroundColor = 'transparent';
    this.oldBorder = this.element.style.border;
    this.element.style.border = 'none';

    // Element.setOpacity(this.element,0);
    this.start(options);
  },

  update: function(position){
    if(this.element.firstChild)
this.element.removeChild(this.element.firstChild);

    if(this.current < this.poofers.length)
    {
      this.element.appendChild(this.poofers[this.current]);
    }
    this.current++;
  },

  finish:  function(position){
    this.element.style.display = 'none';
    if(this.element.firstChild)
this.element.removeChild(this.element.firstChild);
    this.element.appendChild(this.oldChild);

    // ** want to remove these lines
    this.element.style.backgroundColor = this.oldBG;
    this.element.style.border = this.oldBorder;

  }
});



On 6/28/07, Christophe Porteneuve <[EMAIL PROTECTED]> wrote:
>
> Hey JP,
>
> Jean-Philippe Encausse a écrit :
> > But it seems to be really fast even if I set 1 or 15, may be it comes
> > from my application ?
>
> OK, did you set the duration?  An effect defaults to 1 second, so you
> might think it way too fast for your needs.  I looked at the effect's
> code, and it does seem to use fps and duration correctly (at least from
> a cursory glance).
>
> --
> Christophe Porteneuve a.k.a. TDD
> "[They] did not know it was impossible, so they did it." --Mark Twain
> Email: [EMAIL PROTECTED]
>
> >
>


-- 
Jean-Philippe Encausse - Veille / R&D Jalios SA
Jp [at] encausse.net - http://www.encausse.com - http://www.jalias.com
GTalk: jp.encausse [at] gmail.com - SMS: sms [at] jp.encausse.net
Mob: +33682125699 - Job: +33139239283 - Tel: +33139189015 - Fax: +33958789015
Do it Once, Use it Twice ~ Do it Twice, Make It Once

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to