annotate jquery-ui/development-bundle/demos/draggable/cursor-style.html @ 0:b2e4605f20b2

beta version
author dwinter
date Thu, 30 Jun 2011 09:07:49 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
1 <!DOCTYPE html>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
2 <html lang="en">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
3 <head>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
4 <meta charset="utf-8">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
5 <title>jQuery UI Draggable - Cursor style</title>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
6 <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
7 <script src="../../jquery-1.5.1.js"></script>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
8 <script src="../../ui/jquery.ui.core.js"></script>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
9 <script src="../../ui/jquery.ui.widget.js"></script>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
10 <script src="../../ui/jquery.ui.mouse.js"></script>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
11 <script src="../../ui/jquery.ui.draggable.js"></script>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
12 <link rel="stylesheet" href="../demos.css">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
13 <style>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
14 #draggable, #draggable2, #draggable3 { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 0 10px 10px 0; }
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
15 </style>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
16 <script>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
17 $(function() {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
18 $( "#draggable" ).draggable({ cursorAt: { cursor: "move", top: 56, left: 56 } });
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
19 $( "#draggable2" ).draggable({ cursorAt: { cursor: "crosshair", top: -5, left: -5 } });
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
20 $( "#draggable3" ).draggable({ cursorAt: { bottom: 0 } });
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
21 });
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
22 </script>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
23 </head>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
24 <body>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
25
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
26 <div class="demo">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
27
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
28 <div id="draggable" class="ui-widget-content">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
29 <p>I will always stick to the center (relative to the mouse)</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
30 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
31
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
32 <div id="draggable2" class="ui-widget-content">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
33 <p>My cursor is at left -5 and top -5</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
34 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
35
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
36 <div id="draggable3" class="ui-widget-content">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
37 <p>My cursor position is only controlled for the 'bottom' value</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
38 </div>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
39
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
40 </div><!-- End demo -->
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
41
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
42
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
43
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
44 <div class="demo-description">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
45 <p>Position the cursor while dragging the object. By default the cursor appears in the center of the dragged object; use the <code>cursorAt</code> option to specify another location relative to the draggable (specify a pixel value from the top, right, bottom, and/or left). Customize the cursor's appearance by supplying the <code>cursor</code> option with a valid CSS cursor value: default, move, pointer, crosshair, etc.</p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
46 </div><!-- End demo-description -->
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
47
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
48 </body>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
49 </html>