im creating an animation environment for my work, and im - in the part of the queue or fragment of the chain, in fact I have something like this:
var Fx = {
animate: function(){...},
fadeIn: function(){...},
fadeOut: function(){...}
}
etc. etc .... so, actually I can do:
$('#element').animate({options}).fadeIn({options});
and it works great! but fadeIn and the animation are running at the same time, but what I want to do is something like:
$('#element').chain().animate({options}).fadeIn({options});
so that it performs the animation first and then fadeIn
Actually, I have something like:
var Chain = function(element){
var target = element;
for (methodName in Fx) {
(function(methodName) {
Chain.prototype[methodName] = function() {
var args = Array.prototype.slice.call(arguments);
return this;
};
})(methodName);
}
}
Fx.chain = function(element){
return
}
and I can get all the methods called and something like that, but I don’t know how to do this for the array or even call the first method, because I try to get all the requests to the array and just call it every time if the effects are done.
im not using jQuery since i said i need to create a personalized structure.
Any idea pleeeasse ??! Thanks you