|
0
|
1 |
|
|
|
2 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
|
|
3 |
<html> |
|
|
4 |
<head> |
|
|
5 |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> |
|
|
6 |
<title>Proxy Drag</title> |
|
|
7 |
|
|
|
8 |
<style type="text/css"> |
|
|
9 |
/*margin and padding on body element |
|
|
10 |
can introduce errors in determining |
|
|
11 |
element position and are not recommended; |
|
|
12 |
we turn them off as a foundation for YUI |
|
|
13 |
CSS treatments. */ |
|
|
14 |
body { |
|
|
15 |
margin:0; |
|
|
16 |
padding:0; |
|
|
17 |
} |
|
|
18 |
</style> |
|
|
19 |
|
|
|
20 |
<link type="text/css" rel="stylesheet" href="../../build/cssfonts/fonts-min.css" /> |
|
|
21 |
<script type="text/javascript" src="../../build/yui/yui-min.js"></script> |
|
|
22 |
|
|
|
23 |
<!--there is no custom header content for this example--> |
|
|
24 |
|
|
|
25 |
</head> |
|
|
26 |
|
|
|
27 |
<body class=" yui-skin-sam"> |
|
|
28 |
|
|
|
29 |
<h1>Proxy Drag</h1> |
|
|
30 |
|
|
|
31 |
<div class="exampleIntro"> |
|
|
32 |
<p>This example shows a simple proxy drag interaction that doesn't require a drop interaction.</p> |
|
|
33 |
|
|
|
34 |
</div> |
|
|
35 |
|
|
|
36 |
<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== --> |
|
|
37 |
|
|
|
38 |
<style> |
|
|
39 |
#demo { |
|
|
40 |
height: 100px; |
|
|
41 |
width: 100px; |
|
|
42 |
border: 1px solid black; |
|
|
43 |
background-color: #8DD5E7; |
|
|
44 |
cursor: move; |
|
|
45 |
} |
|
|
46 |
</style> |
|
|
47 |
|
|
|
48 |
<div id="demo">Drag Me</div> |
|
|
49 |
|
|
|
50 |
<script> |
|
|
51 |
|
|
|
52 |
YUI({base:"../../build/", timeout: 10000}).use('dd-drag', 'dd-proxy', function(Y) { |
|
|
53 |
var dd = new Y.DD.Drag({ |
|
|
54 |
//Selector of the node to make draggable |
|
|
55 |
node: '#demo' |
|
|
56 |
}).plug(Y.Plugin.DDProxy); //This config option makes the node a Proxy Drag |
|
|
57 |
}); |
|
|
58 |
</script> |
|
|
59 |
|
|
|
60 |
<!--END SOURCE CODE FOR EXAMPLE =============================== --> |
|
|
61 |
|
|
|
62 |
</body> |
|
|
63 |
</html> |