Accéler le défilement de mon texte
salut,
est ce que quelqu'un pourrait m'aider a afficher mon texte plus rapidement svp ?
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| var i = 0;
var mon_span = document.getElementById('mon_span');
var mon_timer;
var txt = '111';
var txt1 = '222';
var txt2 = '333';
window.onload = function() {
mon_span = document.getElementById('mon_span');
}
function test()
{
i = 0;
clearInterval(mon_timer);
mon_span.innerHTML = "";
mon_timer = setInterval(ma_fonction, 100);
function ma_fonction()
{
if(i < txt.length)
{
mon_span.innerHTML += txt.charAt(i++);
}
else
{
i = 0;
clearInterval(mon_timer);
}
}
} |
voilà le rendu plutot lent: http://nicoweb.dixkey.com/lol/
merci :)
merci beaucoup bigboomshakala
merci beaucoup de ton aide bigboom :ccool: