A
A
Alexander Wolf2012-08-14 16:19:15
JavaScript
Alexander Wolf, 2012-08-14 16:19:15

How to execute a function at the end of the animation?

Hello! Tell me please. I have some class that inherits from Fx:

var cl = new Class({
   Extends: Fx,
   initialize: function (elem) {
      this.elem = elem;
   },
   set: function (now) {
      this.setStyle('opacity', now);
   }
});

And I need to perform some function at the end of the animation. How to implement? :)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sdevalex, 2012-08-14
@mannaro

initialize: function (elem) {
    //...
    this.addEvent('complete', function(){ ... });
},

T
theaspin, 2012-08-14
@theaspin

By the way, elements already have a fade method, no new class needed:
mootools.net/docs/core/Fx/Fx.Tween#Element :fade

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question