2010-12-21 64 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來表示它。