我不知道如何可以綁定一個元素上幾個處理函數相同的事件,例如:
$("#this_element").on("click.action1", function(){
/* first thing to run when click this element */
}).on("click.action2", function(){
/* second thing to run when click this element */
}).on("click.action3", function(){
/* last thing to run when click this element */
})
感謝
您正在將處理程序綁定到不同名稱空間中的事件。你真的打算這麼做嗎? – Barmar
http://stackoverflow.com/questions/1491718/jquery-more-than-one-handler-for-same-event –
@Barmar這只是我的猜測,我認爲當我綁定第二個,如果我仍然使用相同的事件名稱字符串,我會覆蓋現有的。 – Kuan