Try the eval statement... might work... function lockMenu(menuId) { eval("var menu_" + menuId + " = true;"); }
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tom ... Sent: Wednesday, January 11, 2006 3:07 PM To: rails-spinoffs@lists.rubyonrails.org Subject: Re: [Rails-spinoffs] [scriptaculous] Intermitently Disabling Clicks I'm pretty new to Javascript (PHP is my specialty), is there a way to make 'variable variables' ( http://nz.php.net/manual/en/language.variables.variable.php ). Say I have this function: function lockMenu(menuId) { var menu_*menuId* = true; } If I ran lockMenu('myAccount'), I'd like the variable menu_myAccount set to false. How would I go about this? Tom. On 1/12/06, Andrew Kaspick <[EMAIL PROTECTED]> wrote: > I think there's a way to check if an effect is running, but am not > 100% on what it is exactly. > > The effect does have a state var that should be set to 'finished' when > it's done, but there is no method to check for that, so I'm not sure > if it's recommended to use or not. > > if you do var e = new Effect... > then you could try doing... > if (e.state == 'finished') or something similar... again, not sure if > this is recommened or not. > > On 1/11/06, Gregory Hill <[EMAIL PROTECTED]> wrote: > > Generally I just keep track of whether it's open or not in a variable > > and check that variable before creating a new animation. So, only do > > the animation if the menu isn't open. > > > > Greg > > > > > -----Original Message----- > > > From: [EMAIL PROTECTED] > > [mailto:rails-spinoffs- > > > [EMAIL PROTECTED] On Behalf Of Tom ... > > > Sent: Wednesday, January 11, 2006 4:21 AM > > > To: rails-spinoffs@lists.rubyonrails.org > > > Subject: [Rails-spinoffs] [scriptaculous] Intermitently Disabling > > Clicks > > > > > > I have button that slides down a menu using Effect.BlindDown, but the > > > function that slides it down also makes it so that the opening link > > > now slides the menu back in. > > > > > > If the user double clicks the link (thuse opening & closing > > > immediatley) the slide animation breaks, then will not extend > > > correctly (but no JS errors). How would you go about stopping this > > > happening? > > > > > > Also, is it just me or is the wiki down more often that not? > > > > > > Tom Rix. > > > _______________________________________________ > > > Rails-spinoffs mailing list > > > Rails-spinoffs@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs The information transmitted in this electronic mail is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers. _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs