View Full Version : Fx.fade
stever
12 Apr 2007, 5:35 PM
I'd like to fade between opacity levels without removing an element. fadeIn always starts at opacity zero, and fadeOut always removes the object. A simple fade between a current level and an end level would be nice.
jack.slocum
12 Apr 2007, 5:51 PM
That's what they were designed for - fading in or out (show/hide). If you just want to animate the opacity, try setOpacity with the animation flag/config.
stever
12 Apr 2007, 6:09 PM
OK, thanks! I though all the animation stuff was in the Fx file, so thats where I looked. The Fx stuff has a config option concurrent, is that available in general Element animations as well?
Thanks again!
jack.slocum
12 Apr 2007, 6:18 PM
Most standard Element functions have an animate parameter. They are completely independent of Fx and queueing and run on their own (concurrent).
stever
12 Apr 2007, 6:25 PM
OK, thanks. I just noticed that there is a way to stop an animation already in progress, and that's all I need! Thanks again!
stever
12 Apr 2007, 6:47 PM
Oops... I still have much more to learn. :) How do I get an anim object from an element so I can stop any animation that might be in progress before I start a new one?
I tried el.anim.opt.anim.stop() but that didn't work..
jack.slocum
12 Apr 2007, 6:56 PM
Did you look at the header of the Element class? It has an example.
stever
12 Apr 2007, 7:19 PM
Yes, but the problem is that any number of places could have started the animation, so I really don't have a reference to it apart from the element itself. Anyhow, that is easily solved by forcing it into the element universally:
if (el.saveopt && el.saveopt.anim)
el.saveopt.anim.stop();
el.setOpacity(0.4,el.saveopt={duration:0.25});
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.