/[projects]/misc/horsensspejder-web/jquery/jquery-ui-1.10.3/demos/droppable/revert.html
ViewVC logotype

Contents of /misc/horsensspejder-web/jquery/jquery-ui-1.10.3/demos/droppable/revert.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2125 - (show annotations) (download) (as text)
Wed Mar 12 19:30:05 2014 UTC (10 years, 3 months ago) by torben
File MIME type: text/html
File size: 1657 byte(s)
initial import
1 <!doctype html>
2 <html lang="en">
3 <head>
4 <meta charset="utf-8">
5 <title>jQuery UI Droppable - Revert draggable position</title>
6 <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
7 <script src="../../jquery-1.9.1.js"></script>
8 <script src="../../ui/jquery.ui.core.js"></script>
9 <script src="../../ui/jquery.ui.widget.js"></script>
10 <script src="../../ui/jquery.ui.mouse.js"></script>
11 <script src="../../ui/jquery.ui.draggable.js"></script>
12 <script src="../../ui/jquery.ui.droppable.js"></script>
13 <link rel="stylesheet" href="../demos.css">
14 <style>
15 #draggable, #draggable2 { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 10px 10px 10px 0; }
16 #droppable { width: 150px; height: 150px; padding: 0.5em; float: left; margin: 10px; }
17 </style>
18 <script>
19 $(function() {
20 $( "#draggable" ).draggable({ revert: "valid" });
21 $( "#draggable2" ).draggable({ revert: "invalid" });
22
23 $( "#droppable" ).droppable({
24 activeClass: "ui-state-hover",
25 hoverClass: "ui-state-active",
26 drop: function( event, ui ) {
27 $( this )
28 .addClass( "ui-state-highlight" )
29 .find( "p" )
30 .html( "Dropped!" );
31 }
32 });
33 });
34 </script>
35 </head>
36 <body>
37
38 <div id="draggable" class="ui-widget-content">
39 <p>I revert when I'm dropped</p>
40 </div>
41
42 <div id="draggable2" class="ui-widget-content">
43 <p>I revert when I'm not dropped</p>
44 </div>
45
46 <div id="droppable" class="ui-widget-header">
47 <p>Drop me here</p>
48 </div>
49
50 <div class="demo-description">
51 <p>Return the draggable (or it's helper) to its original location when dragging stops with the boolean <code>revert</code> option set on the draggable.</p>
52 </div>
53 </body>
54 </html>

  ViewVC Help
Powered by ViewVC 1.1.20