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 开发者_如何学Pythonachieve this ?
Thanks in advance !
Instead of return false
, call e.preventDefault()
.
return false
is equivalent to both e.preventDefault()
and e.stopPropagation()
.
Do you have to use two separate click event handlers? You could just put two function calls in one click handler.
Use event.stopPropagation()
http://api.jquery.com/event.stopPropagation/
精彩评论