jQuery animation if load() returns something different...

Posted by Dan LaManna on Stack Overflow See other posts from Stack Overflow or by Dan LaManna
Published on 2010-12-21T13:01:40Z Indexed on 2010/12/21 13:54 UTC
Read the original article Hit count: 261

Filed under:
|
|
|
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);

So it sets the current first table item to a variable, loads the toparticles div with the tables off the url, and if they are different it will perform the highlight effect, however it does the highlight effect anyway, completely unsure why it isn't working.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery