1
有沒有一種方法可以在用戶點擊通知或點擊關閉按鈕後執行操作?目前我可以使用options.onclick事件來完成第一個選項。但是我看不到我如何在關閉按鈕上執行此操作。或者,有沒有一種方法可以執行我對通知淡出的操作?粘貼toastr onclick關閉按鈕事件
toastr.options = {
"closeButton": true,
"timeOut": "0",
"extendedTimeOut": "0"
};
toastr.options.onclick = function() {
console.log("Notification clicked");
};
toastr.success("Success, Whooo!!");
我沒有用過toastr,但你爲什麼不能結合點擊動作到接近ID或類jQuery的:$(「 closeClass或#ID」)點擊(函數(){做一些事情在這裏} ); – Jeff
看到這個:https://github.com/CodeSeven/toastr#callbacks –