私はこのコードを持っています:
$("#RUN").focusout(function() {
if ($(this).val().length > 0) {
$.post('index.php?User=CheckUser', { "UserName": $("#RUN").val() }, function(result) {
// Var's
var OrigMsg = $("#RUI").text();
var OrigColor = $("#RUI").css("color");
// Code
$("#RUI").slideUp(1000);
$("#RUI").delay(500).queue(function(next) {
$(this).empty();
$(this).css("color", result.color);
$(this).append(result.message);
next();
});
$("#RUI").slideDown(1000).delay(3000).slideUp(1000);
$("#RUI").delay(500).queue(function(next) {
$(this).empty();
$(this).css("color", OrigColor);
$(this).append(OrigMsg);
next();
});
$("#RUI").slideDown(1000);
}, "json");
}
});
アニメーションする ID #RUN のアイテムから出るたびに、次のように設定しようとしました。
$("#RUN").focusout(function() {
$("#RUN").stop();
});
そして、すべてのストップの組み合わせ: stop(true), stop(true,true)
また試しました:
if ($("#RUN").is(":animated")) {
$("#RUN").stop(true,true);
}
そして、すべての停止の組み合わせ。
これがアニメーションループを停止するために .stop() のものをどこに置くべきか、私は本当によく知りません。
編集: HTML コードは次のとおりです。
<td>
<input type="text" id="RUN" name="RUN" maxlength="30" />
</td>
<td>
<div id="RUI" class="InfoItem">
Letras y Numeros, longitud minima 8 caracteres.
</div>
</td>
jsFiddle は $.post() を使用するため作成が少し難しく、今のところローカル PC にしかページがありません。