jQuery clearTimeout不工作?

时间:2012-10-05 02:48:45

标签: jquery settimeout clearinterval

我正在尝试清除此超时,以便在单击此按钮时重新启动,但它无法正常工作:\

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);
});

1 个答案:

答案 0 :(得分:4)

您错误拼写了变量名称:

confirmAblumDelete = setTimeout
        ^^