这是用于排名排行榜的更新。它更改值并临时更改颜色。第一次更改值时,它可以完美运行,但第二次及其后的执行几乎看不到。
channel.bind('amount_update', function(data) {
document.getElementById('active-tokens-' + data.owner).innerHTML = data.active_tokens;
document.getElementById('active-capital-' + data.owner).innerHTML = '$' + (data.active_tokens*.9).toFixed(2);
document.getElementById('historical-tokens-' + data.owner).innerHTML = data.historical_tokens;
document.getElementById('ranking-' + data.owner).innerHTML = (data.ranking).toFixed(2);
function Update() {
document.getElementById('active-tokens-' + data.owner).style.color = "#23cc96";
document.getElementById('active-capital-' + data.owner).style.color = "#23cc96";
document.getElementById('historical-tokens-' + data.owner).style.color = "#23cc96";
}
Update();
function OriginalColor(){
document.getElementById('active-tokens-' + data.owner).style.color = "grey";
document.getElementById('active-capital-' + data.owner).style.color = "grey";
document.getElementById('historical-tokens-' + data.owner).style.color = "grey";
}
c = setInterval(OriginalColor, 2000);
});