diff --git a/jquery.timeago.js b/jquery.timeago.js index 2e8d29f5..b8b93608 100644 --- a/jquery.timeago.js +++ b/jquery.timeago.js @@ -113,7 +113,19 @@ var $s = $t.settings; if ($s.refreshMillis > 0) { - setInterval(function() { self.each(refresh); }, $s.refreshMillis); + var intervalId = setInterval(function() { + var destroyed = 0; + self.each(function() { + if($(this).parents(":last").is("html") == false) { + destroyed++; + } else { + refresh.call(this); + } + }); + if (destroyed === self.length) { + clearInterval(intervalId); + } + }, $s.refreshMillis); } return self; };