问题在于从最后第 5 行开始的 jquery 的动画功能,如果我删除该行它可以正常工作,否则它会使浏览器崩溃{尤其是 firefox},但我需要该动画功能来让用户知道新的更新......可以任何人请告诉我为什么动画功能会导致浏览器崩溃???
function doAnimation() {
var newUpdate = newUpdates.updates[updateIterator] != null ? newUpdates.updates[updateIterator] : null;
var update = "";
while (newUpdate != null) {
if (updateIterator == 0) {
$(".nodata").hide();
}
lastupdateTime = newUpdate.lastUpdate;
update += "<div class='live-updates-data'><img width='48px' height='48px' class='" + newUpdate.clientId + "' src='company_logo/thumb/" + newUpdate.img + "' align='logo' onerror='showDefaultimage(this);' /><h2><span>" + newUpdate.title + "</span></h2> <a style='font-family:Arial, Helvetica, sans-serif' class='" + newUpdate.clientId + " mp'> | Join Chat </a><p>" + newUpdate.updateMessage + "</p></div>";
updateIterator++;
newUpdate = newUpdates.updates[updateIterator] != null ? newUpdates.updates[updateIterator] : null;
} // end of while
// after finishing the while loop
if (update != "") {
$("#shoutBox").prepend(update);
$("#shoutBox div:first-child").animate({
"height": "toggle"
}, "slow", "linear");
}
oTimeout = setTimeout(getShouts, timoutSpeed); //Again start the timout function to ge
updateIterator = 0;
return false;
}