使用JQuery完成一个完整周期后,FadeIn()效果停止工作?

时间:2010-11-02 13:20:41

标签: jquery

我有一个随机问题...在此窗口小部件旋转完整/完整周期后,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">&pound;1</span></li>
                 <li><span class="in-auction-reg">KH52 YBN</span> <span class="in-auction-highest-bid">&pound;2</span></li>
                 <li><span class="in-auction-reg">KH52 YBN</span> <span class="in-auction-highest-bid">&pound;3</span></li>
                 <li><span class="in-auction-reg">KH52 YBN</span> <span class="in-auction-highest-bid">&pound;4</span></li>
                 <li><span class="in-auction-reg">KH52 YBN</span> <span class="in-auction-highest-bid">&pound;5</span></li>
                 <li><span class="in-auction-reg">KH52 YBN</span> <span class="in-auction-highest-bid">&pound;6</span></li>
                 <li><span class="in-auction-reg">KH52 YBN</span> <span class="in-auction-highest-bid">&pound;7</span></li>
                 <li><span class="in-auction-reg">KH52 YBN</span> <span class="in-auction-highest-bid">&pound;8</span></li>
                 <li><span class="in-auction-reg">KH52 YBN</span> <span class="in-auction-highest-bid">&pound;9</span></li>
                 <li><span class="in-auction-reg">KH52 YBN</span> <span class="in-auction-highest-bid">&pound;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);
});

非常感谢任何帮助,谢谢

1 个答案:

答案 0 :(得分:0)

问题在于您是明确添加{opacity:'1'},而不是删除它。只是删除课程不会成功。我建议您添加一个具有不透明度1的类旧推文,或者在

之后显式删除它