2010-12-21 72 views
2
setInterval(function() { 
       var prevTopArticle = $("#toparticles table:first").html(); 
        $("#toparticles").load("myurloffeed.com/topfeed", function() 
        { 
         alternateBG(); 
         var newTopArticle = $("#toparticles table:first").html(); 
          if (prevTopArticle!=newTopArticle) 
           { 
            $("#toparticles table:first").effect("highlight", {color:"#faffc4"}, 2000); 
           } 
        }); 
       }, 8000); 

所以它会将当前第一个表项的变量,装载有过的URL表的toparticles DIV,如果它们是不同的,将进行高光效果,然而它无论如何都会产生突出的效果,完全不确定它为什么不起作用。jQuery的动画,如果负载()返回不同的东西

+1

尝试使用firebug和console.log来查看变量prevTopArticle和newTopArticle中有什么... – Chandu 2010-12-21 13:05:39

+1

'alternateBG'做了什么? – 2010-12-21 13:34:08

回答

0

由于某种原因,其中一篇文章输出Twitter链接,另一篇文章不是,认为Feed是相同的。用两个变量的console.log来表示它。