开发者

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/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜