rlm2008 — 2011-05-06T18:28:23-04:00 — #1
Brains have seized up.
I'm looking into various handler management solutions.
An example, albeit an old one, would be Dean Edwards: addEvent() – My Solution
Trying to think of a scenario where you might want to have multiple handlers and events assigned to an element?
If anyone could give me an example scenario it would be appreciated.
allanp — 2011-05-06T23:29:20-04:00 — #2
How about a click, a mouseover, a mouseout and a double click - all on the same element.
paul_wilkins — 2011-05-07T20:43:32-04:00 — #3
That can still be done though without requiring advanced handler techniques.
Where advanced handler techniques are required is when the same event (such as click) is applied by multiple scripts to the same element.
As an example, you might have the click event on a tabbed link change the background color of that tab.
A completely separate script might also show a contents section when you click on that same tab.
One event will replace the other, unless advanced handler techniques are used.