jQuery clearTimeout isn't working?
-
05-07-2021 - |
문제
I am trying to clear this timeout so it restarts when this button has been clicked, however it isn't working :\
var confirmAlbumDelete;
$("body").on("click", ".upload-result-wrapper .top-details .delete", function(){
clearTimeout(confirmAlbumDelete);
$this = $(this);
$this.text("Yes, Delete Album").addClass("confirm-delete");
confirmAblumDelete = setTimeout(function(){$this.text("Delete Album").removeClass("confirm-delete")},10000);
});
해결책
You misspelled the variable name:
confirmAblumDelete = setTimeout
^^
제휴하지 않습니다 StackOverflow