Pergunta

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);
});
Foi útil?

Solução

You misspelled the variable name:

confirmAblumDelete = setTimeout
        ^^
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top