0
是否可以指定jQuery事件應該被觸發的順序?聽寫事件jquery命令
即
<div class="C1 C2 C3"></div>
$('.C1').click(SomeClickEvent);
$('.C2').click(FirstEvent);
$('.C3').click(LastEvent);
凡FirstEvent始終應首先解僱,LastEvent應該總是最後一個被解僱。 SomeEvent在調用時並不在乎。
的主要原因是FirstEvent可能想阻止其他事件的發射並返回FALSE
假設在事件是綁定的順序不能改變。 還假定事件被綁定到相同的一個DOMElement(或元素)雖然不一定通過相同的選擇器(如上)
最後假設事件一無所知彼此的,是在完全不同的(和可能的不相關的)代碼段。
[這對您有幫助嗎?](http://stackoverflow.com/questions/18482470/how-to-get-true-false-from-on/18482662#18482662) –
http:// stackoverflow。 com/questions/2360655/jquery-event-handlers-always-execute-in-order-they-bound-any-way-around-t –
確實,它們是多個[discutions]/questions/290254/how-to-order-events-bound-with-jquery?rq = 1)。 – Brewal