initial commit
This commit is contained in:
19
js/main.js
Normal file
19
js/main.js
Normal file
@@ -0,0 +1,19 @@
|
||||
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";
|
||||
}
|
||||
Reference in New Issue
Block a user