Naftali
Naftali

Reputation: 146310

Prevent click bubbleup without return false

How do i prevent a bubble up the dom when doing something like this:

$("*").live('mousemove',function(e){
    page.change_state();
});

Where we need any click handler that that element also has to execute, but we dont want this action repeating up the DOM.

We cannot use preventDefault or return false

Upvotes: 2

Views: 365

Answers (1)

Lumi
Lumi

Reputation: 15274

Use event.stopPropagation().

Upvotes: 5

Related Questions