Being a bit bored, I have created what I think is a more clearer-coded version of a menu, similar in functionality to yours. However, your example site is down so I can't compare it. It's at
http://yetagain.net/sandbox/animationmenu/ It uses a general class, Animation at http://yetagain.net/sandbox/animationmenu/Animation.js , to abstract away code for creating Fx.Morphs for each element of an array. These Fx.Morphs are then chained together to form an animation of many parts. It has "forward" and "reverse" methods that allow you to start/interrupt the chain and play it forward/backward, and it accepts custom options for each element's animation. It also allows different options for the "forward" and "reverse", and different for each element. The options for each animation are exactly those that can be passed to the Fx.Morph constructor, and the properties to morph are exactly those that can be passed to the Fx.Morph::start method. This is then used in the class AnimationMenu http://yetagain.net/sandbox/animationmenu/AnimationMenu.js that actually creates the menu by defining each animation. Although I feel it is neater than your solution, it might not have all the functionality of yours. Or there could be bugs!! (Although I don't think it has the bug you mention in your original post). Michal. (Edit: I deleted my original reply, as I put the wrong links in) On Dec 27, 12:54 am, brooklynDev <[email protected]> wrote: > I can see how the code may appear complex for a drop down menu class > at first glance, there could very well be some ways of simplifying it > but for the most part all the complexity is there to provide the > functionality I need. Each of the individual menu items is animating, > as apposed to the whole drop down menu as one movement, and then > there's the timing and event management. The rest of the functionality > should be pretty straightforward on examination of the source, the > little stuff can add up I suppose. > > bd
