Upstream version 9.37.197.0
[platform/framework/web/crosswalk.git] / src / third_party / webdriver / test_data / dragAndDropTest.html
1 <html>
2 <body>
3
4 <style>
5 <!--
6 .dragme{position:relative;}
7 -->
8 </style>
9 <script language="JavaScript1.2">
10 <!--
11
12 var ie=document.all;
13 var nn6=document.getElementById&&!document.all;
14
15 var isdrag=false;
16 var x,y;
17 var dobj;
18
19 function movemouse(e)
20 {
21
22   if (isdrag)
23   {
24     dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x;
25     dobj.style.top  = nn6 ? ty + e.clientY - y : ty + event.clientY - y;
26     return false;
27   }
28 }
29
30 function selectmouse(e)
31 {
32   var fobj       = nn6 ? e.target : event.srcElement;
33   var topelement = nn6 ? "HTML" : "BODY";
34
35   while (fobj.tagName != topelement && fobj.className != "dragme")
36   {
37     fobj = nn6 ? fobj.parentNode : fobj.parentElement;
38   }
39
40   if (fobj.className=="dragme")
41   {
42     isdrag = true;
43     dobj = fobj;
44     tx = parseInt(dobj.style.left+0);
45     ty = parseInt(dobj.style.top+0);
46     x = nn6 ? e.clientX : event.clientX;
47     y = nn6 ? e.clientY : event.clientY;
48     document.onmousemove=movemouse;
49     return false;
50   }
51 }
52
53 document.onmousedown=selectmouse;
54 document.onmouseup=new Function("isdrag=false");
55
56 //-->
57 </script>
58
59
60
61 <img src="icon.gif" class="dragme" id="test1"><br>
62 <img src="icon.gif" class="dragme" id="test2"><br>
63 <b>"Hi there</b>
64 <div style="position: absolute; left: 210px; top: 80px; height: 400px; width: 100px; padding: 10em;">
65 <img src="icon.gif" class="dragme" id="test3"><br>
66 <img src="icon.gif" class="dragme" id="test4"><br>
67 </div>
68 </body>
69 </html>