1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-15 23:35:34 +00:00

[test] test for 2 setTimeout at the same time

This commit is contained in:
Witold Filipczyk 2022-09-07 18:33:45 +02:00
parent 813e2e595f
commit 6a7d8ba7bc

View File

@ -0,0 +1,36 @@
<html>
<head>
<script>
var tekstA = ' ELinks';
function scrollTextA() {
var znak = tekstA.charAt(0);
tekstA = tekstA.substring(1, tekstA.length) + znak;
return '<pre>' + tekstA.substring(0, 80) + '</pre>';
}
function scrollA() {
document.getElementById('s').innerHTML = scrollTextA();
window.setTimeout(scrollA, 100);
}
var tekst = ' ELinks';
function scrollText() {
var znak = tekst.charAt(0);
tekst = tekst.substring(1, tekst.length) + znak;
return '<pre>' + tekst.substring(0, 80) + '</pre>';
}
function scroll() {
document.getElementById('s2').innerHTML = scrollText();
window.setTimeout(scroll, 150);
}
function start() {
scroll();
scrollA();
}
</script>
</script>
</head>
<body onload="start()">
<div id="s"></div>
<div id="s2"></div>
</body>
</html>