JQuery fadeOut は 2 回目は実行されません。
<div id="clickme">click here</div>
JS
$('#clickme').click(function() {
$('#feedback').html('hello world').fadeOut('slow', function() {
$(this).remove();
});
});
削除せずに試しました。その場合も機能しません。
JQuery fadeOut は 2 回目は実行されません。
<div id="clickme">click here</div>
JS
$('#clickme').click(function() {
$('#feedback').html('hello world').fadeOut('slow', function() {
$(this).remove();
});
});
削除せずに試しました。その場合も機能しません。
1/ 要素を削除せず、代わりに非表示にします。
2/ フェードアウトの前に要素を表示する必要があります。既に非表示になっている場合、要素はフェードアウトしません。(またはanimate
適切なパラメータで使用)
$('#clickme').click(function() {
$('#feedback').html('hello world').show().fadeOut('slow', function() {
$(this).hide();
});
});
アニメーション化する要素を削除しました
$('#feedback').html('hello world').fadeOut('slow', function() {
$(this).remove();
});
クリックコントロールを適切にアンバインドして
$('#clickme').unbind().click(function() {
//your content
});
何をしようとしているのかわかりませんが、最初から要素を削除しているため、2回目は機能しません
$('#clickme').click(function() {
$('#feedback').html('hello world').fadeOut('slow', function() {
$(this).remove(); // <----- you are removing the feedback element so in the second time there will be no "$('#feedback')" because of that its not working
});
});