JavaScript text word for word output compact case

It workers 2022-06-23 17:48:26 阅读数:527

javascripttextwordwordoutput

javascript Verbatim output case

// Dynamic text prompt
var txtArr = [' Welcome to developers ', ' focus Web Front end development and PHP Programming '],
x = 1,
y = 0,
txt = txtArr[y],
timer = null,
timer1 = null,
cue = $('.menutext');
function changTxt() {
if (x == txt.length+1) {
clearTimeout(timer1);
timer1 = setInterval(function(){
y += 1;
if (y > txtArr.length - 1) y = 0;
cue.text('');
txt = txtArr[y];
x=0;
},5500);
}
cue.text(txt.substring(0,x));
x+=1;
clearTimeout(timer);
timer = setTimeout(function(){
changTxt();
},600);
}
changTxt(); 
版权声明:本文为[It workers]所创,转载请带上原文链接,感谢。 https://qdmana.com/2022/01/202201051804123499.html