is it possible to execute a function in all events
That's the spirit
jscharf
2009-08-26 06:55:19
+1
A:
To do so, you will most likely have to explicitly specify which events you wish to bind to, unless there is a way to get a list of all event names. Keep in mind different elements have different events as well.
You could do something like this:
eventNames = "click mouseenter keyup keydown etc.."; // all events you wish to bind to
yourFunction = function() { };
$(/* selector for your elements */).bind(eventNames, yourFunction);
Here is the list of possible event values from the jQuery documentation:
blur, focus, load, resize, scroll, unload, beforeunload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error
jscharf
2009-08-26 03:12:58