cssでdsplayをnoneにしているcloneをクローンしたいのですが、$('.bid').hide();には成功するもののcloneされません。
どうすれば良いでしょうか。
JS
1 2//該当部分のみ記載 3<div class="dobid"> 4 5 <?php if ($end == false): ?> 6 7 <div class="bid"> 8 <a href="#">入札する</a> 9 <span class="time">残り</span> 10 </div> 11 12 <p id="clone">このオークションは終了しました</p> 13 14 <?php elseif ($end == true): ?> 15 16 <p>このオークションは終了しました</p> 17 18 <?php endif ?> 19 20 </div> 21 22 var recalc = function() { 23 var count = countdown(cutoff); 24 if (count[2] < 0) { 25 // location.reload(); 26 $('.bid').hide(); 27 $('#clone').clone().prepend('.dobid').fadeIn(); 28 } else { 29 console.log(count[1]); 30 var time = count[1] + '時間' + count[2] + '分' + count[3] + '秒'; 31 $('.time').text(time); 32 refresh(); 33 } 34 } 35 36//該当部分のみ記載 37 var refresh = function() { 38 setTimeout(recalc, 1000); 39 } 40 41 if (end == false) { 42 var count = countdown(cutoff); 43 44 if (count[2] < 0) { 45 $('.bid').hide(); 46 $('#clone').clone().prepend('.dobid').fadeIn(); 47 } else if (count[1] < 1) { 48 recalc(); 49 } else { 50 var time = count[1] + '時間' + count[2] + '分' + count[3] + '秒'; 51 $('.time').text(time); 52 } 53 }
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/01/31 13:48