我有一个随机问题...在此窗口小部件旋转完整/完整周期后,fadeIn()效果会停止工作吗?
这是我的HTML& CSS
.new-tweet { opacity:0; filter:alpha(opacity=0); }
#in-auction-cycle-content { overflow:hidden; width:275px; height:102px; list-style-type:none; margin-bottom:6px; }
<ul id="in-auction-cycle-content">
<li><span class="in-auction-reg">KH52 YBN</span> <span class="in-auction-highest-bid">£1</span></li>
<li><span class="in-auction-reg">KH52 YBN</span> <span class="in-auction-highest-bid">£2</span></li>
<li><span class="in-auction-reg">KH52 YBN</span> <span class="in-auction-highest-bid">£3</span></li>
<li><span class="in-auction-reg">KH52 YBN</span> <span class="in-auction-highest-bid">£4</span></li>
<li><span class="in-auction-reg">KH52 YBN</span> <span class="in-auction-highest-bid">£5</span></li>
<li><span class="in-auction-reg">KH52 YBN</span> <span class="in-auction-highest-bid">£6</span></li>
<li><span class="in-auction-reg">KH52 YBN</span> <span class="in-auction-highest-bid">£7</span></li>
<li><span class="in-auction-reg">KH52 YBN</span> <span class="in-auction-highest-bid">£8</span></li>
<li><span class="in-auction-reg">KH52 YBN</span> <span class="in-auction-highest-bid">£9</span></li>
<li><span class="in-auction-reg">KH52 YBN</span> <span class="in-auction-highest-bid">£10</span></li>
</ul>
这是我的JQuery
$(document).ready(function(){
function tweet(){
$("#in-auction-cycle-content li:last").hide().addClass('new-tweet').prependTo("#in-auction-cycle-content").slideDown(300);
$('.new-tweet').animate({opacity: '1'}, function(){$(this).removeClass('new-tweet')});
};
setInterval(tweet,3600);
});
非常感谢任何帮助,谢谢
答案 0 :(得分:0)
问题在于您是明确添加{opacity:'1'},而不是删除它。只是删除课程不会成功。我建议您添加一个具有不透明度1的类旧推文,或者在
之后显式删除它