gkpo
gkpo

Reputation: 2662

prioritise jquery events

Please have a look at this script.

Here is my problem: I want both events to be fired by the click event. The thing is one of them returns false, what logically makes jquery ignore the second one (and I need it to return false).

Any idea how I can achieve this ?

Thanks in advance !

Upvotes: 0

Views: 149

Answers (3)

jfriend00
jfriend00

Reputation: 707406

Do you have to use two separate click event handlers? You could just put two function calls in one click handler.

Upvotes: 1

Ilia Choly
Ilia Choly

Reputation: 18557

Use event.stopPropagation() http://api.jquery.com/event.stopPropagation/

Upvotes: 0

SLaks
SLaks

Reputation: 887449

Instead of return false, call e.preventDefault().
return false is equivalent to both e.preventDefault() and e.stopPropagation().

Upvotes: 1

Related Questions