| 1 | <!doctype html> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <meta charset="utf-8"> |
| 5 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 6 | <title>jQuery UI Draggable - Revert position</title> |
| 7 | <link rel="stylesheet" href="../../themes/base/all.css"> |
| 8 | <link rel="stylesheet" href="../demos.css"> |
| 9 | <style> |
| 10 | #draggable, #draggable2 { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 0 10px 10px 0; } |
| 11 | </style> |
| 12 | <script src="../../external/requirejs/require.js"></script> |
| 13 | <script src="../bootstrap.js"> |
| 14 | $( "#draggable" ).draggable({ revert: true }); |
| 15 | $( "#draggable2" ).draggable({ revert: true, helper: "clone" }); |
| 16 | </script> |
| 17 | </head> |
| 18 | <body> |
| 19 | |
| 20 | <div id="draggable" class="ui-widget-content"> |
| 21 | <p>Revert the original</p> |
| 22 | </div> |
| 23 | |
| 24 | <div id="draggable2" class="ui-widget-content"> |
| 25 | <p>Revert the helper</p> |
| 26 | </div> |
| 27 | |
| 28 | <div class="demo-description"> |
| 29 | <p>Return the draggable (or it's helper) to its original location when dragging stops with the boolean <code>revert</code> option.</p> |
| 30 | </div> |
| 31 | </body> |
| 32 | </html> |