source: main/trunk/greenstone3/web/interfaces/oran/js/jquery-ui-1.8rc1/demos/draggable/visual-feedback.html@ 24245

Last change on this file since 24245 was 24245, checked in by sjb48, 13 years ago

Oran code for supporting format changes to document.

  • Property svn:executable set to *
File size: 2.9 KB
Line 
1<!doctype html>
2<html lang="en">
3<head>
4 <title>jQuery UI Draggable - Visual feedback</title>
5 <link type="text/css" href="../../themes/base/ui.all.css" rel="stylesheet" />
6 <script type="text/javascript" src="../../jquery-1.4.1.js"></script>
7 <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
8 <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
9 <script type="text/javascript" src="../../ui/jquery.ui.mouse.js"></script>
10 <script type="text/javascript" src="../../ui/jquery.ui.draggable.js"></script>
11 <link type="text/css" href="../demos.css" rel="stylesheet" />
12 <style type="text/css">
13 #draggable, #draggable2, #draggable3, #set div { width: 90px; height: 90px; padding: 0.5em; float: left; margin: 0 10px 10px 0; }
14 #draggable, #draggable2, #draggable3 { margin-bottom:20px; }
15 #set { clear:both; float:left; width: 368px; height: 120px; }
16 p { clear:both; margin:0; padding:1em 0; }
17 </style>
18 <script type="text/javascript">
19 $(function() {
20 $("#draggable").draggable({ helper: 'original' });
21 $("#draggable2").draggable({ opacity: 0.7, helper: 'clone' });
22 $("#draggable3").draggable({
23 cursor: 'move',
24 cursorAt: { top: -12, left: -20 },
25 helper: function(event) {
26 return $('<div class="ui-widget-header">I\'m a custom helper</div>');
27 }
28 });
29 $("#set div").draggable({ stack: { group: '#set div', min: 1 } });
30 });
31 </script>
32</head>
33<body>
34<div class="demo">
35
36<h3 class="docs">With helpers:</h3>
37
38<div id="draggable" class="ui-widget-content">
39 <p>Original</p>
40</div>
41
42<div id="draggable2" class="ui-widget-content">
43 <p>Semi-transparent clone</p>
44</div>
45
46<div id="draggable3" class="ui-widget-content">
47 <p>Custom helper (in combination with cursorAt)</p>
48</div>
49
50<h3 class="docs">Stacked:</h3>
51<div id="set">
52 <div class="ui-widget-content">
53 <p>We are draggables..</p>
54 </div>
55
56 <div class="ui-widget-content">
57 <p>..whose z-indexes are controlled automatically..</p>
58 </div>
59
60 <div class="ui-widget-content">
61 <p>..with the stack option.</p>
62 </div>
63</div>
64
65</div><!-- End demo -->
66
67<div class="demo-description">
68
69<p>Provide feedback to users as they drag an object in the form of a helper. The <code>helper</code> option accepts the values 'original' (the draggable object moves with the cursor), 'clone' (a duplicate of the draggable moves with the cursor), or a function that returns a DOM element (that element is shown near the cursor during drag). Control the helper's transparency with the <code>opacity</code> option.</p>
70
71<p>To clarify which draggable is in play, bring the draggable in motion to front. Use the <code>zIndex</code> option to set a higher z-index for the helper, if in play, or use the <code>stack</code> option to ensure that the last item dragged will appear on top of others in the same group on drag stop.</p>
72
73</div><!-- End demo-description -->
74</body>
75</html>
Note: See TracBrowser for help on using the repository browser.