-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcp_spin.js
More file actions
33 lines (26 loc) · 898 Bytes
/
Copy pathcp_spin.js
File metadata and controls
33 lines (26 loc) · 898 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
/*
New Perspectives on HTML and CSS, 7th Edition
Tutorial 8
Tutorial Case
Filename: cp_spin.js
Purpose: The purpose of this program is to synchronize
the play and pause of the spin animation with the
play and pause of the video player
*/
window.onload = function() {
document.getElementById("rotateVideo").onclick=pausePlayAnimVid;
}
function pausePlayAnimVid() {
if (document.getElementById("rotateVideo").checked) {
document.getElementsByTagName("video")[0].play();
document.getElementsByTagName("video")[0].loop=true;
} else {
document.getElementsByTagName("video")[0].pause();
document.getElementsByTagName("video")[0].loop=false;
}
}
// Custom Code
function cst() {
//document.getElementsByTagName("video")[0].currentTime = "30";
alert(animation.currentTime);
}