我想创建并显示每秒增加固定数量的值。如何创建动态增加值?
我在我的PHP文件中的以下变量:
$ AccountValue = 220000; $ IncreasePerSecond = 15;
因此,例如,当页面加载值是22万1秒后值是220015接连第二220030 ....等
在此先感谢
我想创建并显示每秒增加固定数量的值。如何创建动态增加值?
我在我的PHP文件中的以下变量:
$ AccountValue = 220000; $ IncreasePerSecond = 15;
因此,例如,当页面加载值是22万1秒后值是220015接连第二220030 ....等
在此先感谢
这不是完整的答案,但它应该给你的基础:
var count = 0;
setIncrement("doSomething()", 1000);
function doSomething()
{
document.getElementById("my_div").innerHTML = ++count;
}
见http://www.elated.com/articles/javascript-timers-with-settimeout-and-setinterval/