-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdragtest.js
More file actions
50 lines (44 loc) · 1.28 KB
/
dragtest.js
File metadata and controls
50 lines (44 loc) · 1.28 KB
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
window.onload = run;
function run()
{
var cpd = new Drag(".drg", null, null, null, false, true);
console.log("User agent="+navigator.userAgent);
var bd;
bd = document.getElementById("makeDrag");
if (bd)
{
bd.addEventListener("click", function ()
{
new Drag("#draginternal", null, null, null, false);
})
}
bd = document.getElementById("makeDragBody");
if (bd)
{
bd.addEventListener("click", function ()
{
new Drag("#draginternal", null, null, null, true);
})
}
var btn = document.getElementById("btn");
if (btn && btn != null)
{
btn.addEventListener("click", function ()
{
var txt = document.getElementById("txtfld");
txt.value += "Clicked! ";
});
}
var btn = document.getElementById("b1");
if (btn && btn != null)
{
btn.addEventListener("click", function ()
{
var n1 = parseFloat(document.getElementById("ti1").value);
var n2 = parseFloat(document.getElementById("ti2").value);
document.getElementById("ti1").value = n1;
document.getElementById("ti2").value = n2;
document.getElementById("ti3").value = n1 + n2;
});
}
}