javascript - Is there a JQuery function to handle all mouse events at once? -
What is a JQuery function (or plugin) to handle at once?
For example, to handle all click events on a page, I Delegate event handling to hear you for all mouse events through event propaganda You can use. You can pass multiple event names in the same event handler. You can see the event parameter, when there is a fire to look at the incident, in which the event occurred, where the DOM object The advantage of this is that it works for all the elements of the page, even the dynamic objects are included, you have been added after installing the event handler. The only way to do this is to prevent the default behavior of the event, because it can already be processed by an event handler attached to an object (except that you $ ("*"). Click () , but I'm thinking that there is such a function:
$ ("*"). Mouse Event ("event type", function () {// handle all events based on their event type in an event list});
$ (document) .on ("mouseup mousedown click mousemove", function (e) {// e.type is the type of event / / e.target element originally happened}} is;);
e.preventDefault () because they apparently do not seem to fire until the event spread.
Comments
Post a Comment