javascript - how to add event for all elements except which have a certain class? -
I want to add the mouse over all elements on the page above the event, besides the square "no_inspect",
$ ('*: not (.no_inspect)') Mouseover (mouseoverrecovery);
But that does not work, something goes missing.
UPDATE does not mean working:
The event is enclosed on the page "all the elements have no property or not" that I want that it is not behavior.
UPDATE MouseoverEvents Code:
function DIOnMouseOver (evt) {element = evt.target; // Set the range around the element element. Style.borderWidth = '2px'; Element.style.borderStyle = 'Solid'; Element.style.borderColor = '# f00'; }
mouseover
event Try the bubbles instead mousecenter
.
Besides, why are you implementing the style for evt.target
? Why not 'this'?
function DIOnMouseOver (evt) {$ (this). Css ({range: '2px solid # f00'}); }
As stated in the comments, another way to avoid publicity is to event.stopPropagation ()
Call your event handler.
Comments
Post a Comment