On 22/02/2012 11:58, hamburger wrote:
You are right Dimitar.
Does this make sense?
http://jsfiddle.net/4YsUV/10/


Yes, why not - mootools is what you make out of it - though your method is not chainable as is - it defers the action and returns nothing. add return this;

even so, the return this can have unexpected behaviours if you destroy the element before it runs.

eg. $("foo").fadeout(5000).destroy(); -> 5 second later, you have an exception. this sort of pattern does not allow you to check if the element still exists when it runs nor does it degrade gracefully when it does not nor does it cater for management of timers - what happens when you .fadeout(3000).fadeout(3010)?

will create 2 separate functions with no respect for tweening going on at the moment.

if none of that is a concern, you don't need to go to dealing with element.tween directly and manage it. else, you may be better off doing that instead.
--
Dimitar Christoff

"JavaScript is to JAVA what hamster is to ham"
http://fragged.org/ | @D_mitar | https://github.com/DimitarChristoff

Reply via email to