univ.phundrak.fr/js/main.js

20 lines
362 B
JavaScript
Raw Normal View History

2018-09-29 19:47:26 +00:00
window.onload = main;
var d = document;
var de = d.documentElement;
var offset = 0;
function main() {
console.log("JS loaded");
setInterval(frame, 1000.0 / 60.0);
}
function frame() {
if (offset >= (de.clientWidth)) {
offset = -100;
} else {
offset += 3;
}
d.getElementById("carre").style.marginLeft = offset + "px";
}