-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode.js
More file actions
33 lines (27 loc) · 879 Bytes
/
Copy pathcode.js
File metadata and controls
33 lines (27 loc) · 879 Bytes
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
31
32
33
//set a fucnction//
function updatetext(){
//button input and change output//
function init(){
imgObj = document.getElementById('myImage');
imgObj.style.position= 'relative';
imgObj.style.left = '0px';
}
function startStop(){
moveRight();
change();
}
function moveRight(){
imgObj.style.left = parseInt(imgObj.style.left) + 10 + 'px';
animate = setTimeout(moveRight,50);
}
function change(){
var elem = document.getElementById("startButton");
if (elem.value=="Stop") elem.value = "Start";
else elem.value = "Stop";
}
function stop(){
clearTimeout(animate);
}
window.onload =init;
document.getElementById("heading").innerHTML = "javascript is awesome"
}