Surely has something to do with trying to toggle an item when it is already in the middle if a toggle transition. You might be able to bail out and start rendering the reverse of the current toggle animation by usingone of the callbacks and starting your new render at the complement of whatever point the current render bailed out at:
http://wiki.github.com/madrobby/scriptaculous/core-effects On Mar 10, 4:19 am, mikaeru <[email protected]> wrote: > Hello there, I tried to implement two toggle buttom stay next to each > other. > if any buttom is toggled then it should be toggled back automatically > while click on the other one. > > The codes below actually do the work, however, if somebody clicks on > both buttoms in a second. > it mess up the code as well as its behavior. > I'm rather new to the prototype, so the code might look a little bit > exhuasted. > > any suggestion and help? > > var isRightToggled = 0; > var isLeftToggled = 0; > contentToggleLeft = function() { > if(isLeftToggled) { > isLeftToggled = 0; > } > else { > isLeftToggled = 1; > } > if(isRightToggled) { > isRightToggled = 0; > new Effect.toggle('content-left', 'slide'); > setTimeout("Effect.toggle('content-right', > 'slide');", 1000); > } > else { > new Effect.toggle('content-right', 'slide'); > } > > } > > contentToggleRight = function() { > if(isRightToggled) { > isRightToggled = 0; > } > else { > isRightToggled = 1; > } > if(isLeftToggled) { > isLeftToggled = 0; > new Effect.toggle('content-right', 'slide'); > setTimeout("Effect.toggle('content-left', 'slide');", > 1000); > } > else { > new Effect.toggle('content-left', 'slide'); > } > > } -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
