If you need to trigger a lot of functions when you click the mouse, but generally we do not write all directly to the click event, you need to dynamically add the function according to the situation
Before using a listener to add
The following methods in addition to the implementation of the above functional code more concise, transfer parameters more powerful
Used to dynamically add an event after the handler function//loop traversal event Post handler function//funnames--specifies functions that need to be performed function event (args, Funnames) {for (var i in _eventafter) {if Typ EOF (_eventafter[i]) = = "function" && funnames.indexof (i) >= 0) {_eventafter[i] (args);} }//Event-processed var _eventafter = new Eventafter (); function Eventafter (Outargs) {//external parameters are brought into the This.args////can be used internally by the positive external definition of internal parameters for the purpose of course you can add additional parameters by itself}//define functions in the Post handler function _ Eventafter.args = ' _eventafterargs '; _eventafter.afun = function (outarg) {alert (_eventafter.args + "" + Outarg);} Excite Event Events (' _eventafteroutarg ', ' afun ');