-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
110 lines (98 loc) · 3.32 KB
/
index.html
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>CMSD Aeolus Hunt Puzzle Cards</title>
<style>
.dragme {
position:relative;
width: 270px;
height: 203px;
cursor: move;
}
#draggable {
background-color: #ccc;
border: 1px solid #000;
}
</style>
<script> function startDrag(e) {
// determine event object
if (!e) {
var e = window.event;
}
// IE uses srcElement, others use target
var targ = e.target ? e.target : e.srcElement;
if (targ.className != 'dragme') {
return
};
// calculate event X, Y coordinates
offsetX = e.clientX;
offsetY = e.clientY;
// assign default values for top and left properties
if (!targ.style.left) {
targ.style.left = '0px'
};
if (!targ.style.top) {
targ.style.top = '0px'
};
// calculate integer values for top and left
// properties
coordX = parseInt(targ.style.left);
coordY = parseInt(targ.style.top);
drag = true;
// move div element
document.onmousemove = dragDiv;
}
function dragDiv(e) {
if (!drag) {
return
};
if (!e) {
var e = window.event
};
var targ = e.target ? e.target : e.srcElement;
// move div element
targ.style.left = coordX + e.clientX - offsetX + 'px';
targ.style.top = coordY + e.clientY - offsetY + 'px';
return false;
}
function stopDrag() {
drag = false;
}
window.onload = function () {
document.onmousedown = startDrag;
document.onmouseup = stopDrag;
}
</script>
<script src="audiojs/audio.min.js"></script>
<script>
audiojs.events.ready(function() {
var as = audiojs.createAll();
});
</script>
</head>
<body>
<center><h2>String Quartet No.1 in B flat major, Op.1 'Hunt' (opening excerpt)</h2>
<i>Franz Joseph Haydn (1732 † 1809)</i><p>
<audio src="huntaeolus.mp3" preload="auto" loop="loop" />
</center>
<p>
<p>
<p>
<p>
<p>
<p>
<p>
<img src="img/card1.png" alt="drag-and-drop image script" title="drag-and-drop image script" class="dragme" border="3">
<img src="img/card2.png" alt="drag-and-drop image script" title="drag-and-drop image script" class="dragme" border="3">
<img src="img/card1.png" alt="drag-and-drop image script" title="drag-and-drop image script" class="dragme" border="3">
<img src="img/card2.png" alt="drag-and-drop image script" title="drag-and-drop image script" class="dragme" border="3">
<img src="img/card3.png" alt="drag-and-drop image script" title="drag-and-drop image script" class="dragme" border="3">
<img src="img/card4.png" alt="drag-and-drop image script" title="drag-and-drop image script" class="dragme" border="3">
<img src="img/card3.png" alt="drag-and-drop image script" title="drag-and-drop image script" class="dragme" border="3">
<img src="img/card5.png" alt="drag-and-drop image script" title="drag-and-drop image script" class="dragme" border="3">
<img src="img/card6.png" alt="drag-and-drop image script" title="drag-and-drop image script" class="dragme" border="3">
<img src="img/card7.png" alt="drag-and-drop image script" title="drag-and-drop image script" class="dragme" border="3">
<img src="img/card8.png" alt="drag-and-drop image script" title="drag-and-drop image script" class="dragme" border="3">
</body>
</html>