【发布时间】:2013-12-18 09:40:47
【问题描述】:
我需要一些帮助来增加值/每秒 1。
我有
<script>
function incrementValue()
{
var value = parseInt(document.getElementById('number').value, 10);
value = isNaN(value) ? 0 : value;
value++;
document.getElementById('number').value = value;
return false;
}
</script>
现在我需要一个函数来增加“数字”的值并开始每秒添加 +1,直到我点击另一个图像。
我唯一能做的是:
function incrementvale()
var incrementTime = 1;
var incrementBy = 1;
private var counter = 0;
function Start () {
InvokeRepeating("Increment", incrementTime, incrementTime);
}
function Increment () {
counter += incrementBy;
}
这是非常错误的! 问题!
当我点击图片时。
函数开始。
该函数每秒将“number”的值增加 1。
谢谢
【问题讨论】:
标签: javascript timer increment