好的....我“避免”了这个问题....我需要将 setTimeout 停止 1000 毫秒,然后让它正常工作...我尝试过...而不是暂停 setTimeout 我放了另一个时间变量。
var time = 1000;
var timecache = 1000;
fatica = 3000;
sudore = 3000;
function interval() { timeout = setTimeout(increment, time);} //here setTimeout uses var time//
function increment(){console.log(time);point += 1;document.getElementById("pul").value = point;interval();}
function fermafatica() {time = timecache;setInterval(ferma, fatica);} //here the function equals time to timecache so vas time is always 1000ms//
function ferma(){time = 10000; setTimeout(fermafatica, sudore);} // then here I transformed the time in 10000 so the first function will take 10000 instead of 1000 in setTimeout//
//plus i put a setTimeout to recall function fermafatica() that reset the time to 1000//
这就是我想要的...我避免了这个问题并找到了另一种方法来做到这一点...但它有效...无论如何谢谢