1

is it possible to execute a function in all events

1
  • mousemove on the whole page? hmm... Commented Aug 26, 2009 at 3:08

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.