-Lost said the following on 12/21/2006 6:51 PM:
"Randy Webb" <Hi************@aol.comwrote in message
news:g4********************@telcove.net...
>Steve said the following on 12/21/2006 4:03 PM:
>>I want to disable the onclick for a <div>. In onclick I am using
Spry.Effect.AppearFade(...). Any suggestions on how to disable onclick
after the first initial click from the user?
onclick="someFunction();this.onclick = null"
Heh. Well, Steve said "disable" not "kill".
I did both :)
Offhand, is there a way to revive the event handler (after nullifying it)?
Store a reference to it and then set it back.
onclick="someFunction();this.oldOnClick=this.oncli ck;this.onclick=null"
And then some way to restore it:
document.getElementById('thatElement').onclick=doc ument.getElementById('thatElement').oldOnClick
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -
http://jibbering.com/faq/index.html
Javascript Best Practices -
http://www.JavascriptToolbox.com/bestpractices/