Oh, now I see. Try creating a separate class that contains that behavior, and extending each menu div (or whatever element they are), with that class... then you can use "this" within the functions to check the locked status of the individual menu.
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tom ... Sent: Wednesday, January 11, 2006 3:24 PM To: [email protected] Subject: Re: [Rails-spinoffs] [scriptaculous] Intermitently Disabling Clicks Stay me away from eval! Well, I don't see why, but I know the general idea that it is bad. function showProjectMenu(id) { if (menusUnlocked == 'yes') { Effect.BlindDown('project' + id); lockMenus(); $('project' + id + '_link').onclick=function() { hideProjectMenu(id) } $('project' + id + '_image').src = "/images/icons/folderOpen.gif"; setTimeout('unlockMenus()', 1000); } } function hideProjectMenu(id) { if (menusUnlocked == 'yes') { Effect.BlindUp(id, {duration:0.25}); lockMenus(); $('project' + id + '_link').onclick=function() { changeProject(id) } $('project' + id + '_image').src = "/images/icons/folderClosed.gif"; setTimeout('unlockMenus()', 250); } } function lockMenus() { menusUnlocked = 'no'; } function unlockMenus() { menusUnlocked = 'yes'; } That will lock the entire interface for the duration of the animation, only 1/4 second so its not a big deal. Tom. On 1/12/06, Ryan Gahl <[EMAIL PROTECTED]> wrote: > Try the eval statement... might work... > > function lockMenu(menuId) { > eval("var menu_" + menuId + " = true;"); > } _______________________________________________ Rails-spinoffs mailing list [email protected] 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 [email protected] http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
