function SetText(gg = `textttttt `, cmd = `sudo --info`) {
window.scrollTo({ top: 0, behavior: 'smooth' });
if (document.getElementsByClassName('demo').length > 0) {
var i = 0;
var speed = 60;
document.getElementsByClassName('demo')[0].innerHTML = `<code class="shell-session demo hljs nginx"><span class="hljs-attribute">Website</span> <span class="hljs-regexp">~ $</span> ${cmd}`;
function typeItOut() {
if (i < gg.length) {
document.getElementsByClassName('demo')[0].innerHTML += gg.charAt(i);
i++;
setTimeout(typeItOut, speed);
}
}
setTimeout(typeItOut, 1800);
}
}
所以这就是代码,我希望每次我点击我网站上的一个按钮时,它都会等到递归完成然后再开始另一个......