aboutsummaryrefslogtreecommitdiffstats
path: root/demos/droppable/revert.html
diff options
context:
space:
mode:
authorPaul Bakaus <paul.bakaus@googlemail.com>2008-12-30 16:12:20 +0000
committerPaul Bakaus <paul.bakaus@googlemail.com>2008-12-30 16:12:20 +0000
commita16c0e805eb9451dfe3a44e6f4db73ecd6aac750 (patch)
treee68be25c2d9254cca1f0c817493623e0e479c552 /demos/droppable/revert.html
parent64f72357a5dc0aed01eda72d101e9baa8275a606 (diff)
downloadjquery-ui-a16c0e805eb9451dfe3a44e6f4db73ecd6aac750.tar.gz
jquery-ui-a16c0e805eb9451dfe3a44e6f4db73ecd6aac750.zip
demos: added revert 'valid', 'invalid' demos to droppables, droppable connection demo to sortables
Diffstat (limited to 'demos/droppable/revert.html')
-rw-r--r--demos/droppable/revert.html47
1 files changed, 47 insertions, 0 deletions
diff --git a/demos/droppable/revert.html b/demos/droppable/revert.html
new file mode 100644
index 000000000..4c7333127
--- /dev/null
+++ b/demos/droppable/revert.html
@@ -0,0 +1,47 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <title>jQuery UI Droppable - revert</title>
+ <link type="text/css" href="../demos.css" rel="stylesheet" />
+ <link type="text/css" href="../../themes/default/ui.all.css" rel="stylesheet" />
+ <script type="text/javascript" src="../../jquery-1.2.6.js"></script>
+ <script type="text/javascript" src="../../ui/ui.core.js"></script>
+ <script type="text/javascript" src="../../ui/ui.draggable.js"></script>
+ <script type="text/javascript" src="../../ui/ui.droppable.js"></script>
+ <style type="text/css">
+ .ui-widget-header { width: 150px; height: 150px; padding: 0.5em; float: left; margin: 10px; }
+ .ui-widget-content { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 10px; }
+ </style>
+ <script type="text/javascript">
+ $(function() {
+
+ $("#draggable").draggable({ revert: 'valid' });
+ $("#draggable2").draggable({ revert: 'invalid' });
+
+ $("#droppable").droppable({
+ activeClass: 'ui-state-hover',
+ hoverClass: 'ui-state-active',
+ drop: function(event, ui) {
+ $(this).addClass('ui-state-highlight').find('p').html('Dropped!');
+ }
+ });
+
+ });
+ </script>
+</head>
+<body>
+
+<div id="draggable" class="ui-widget-content">
+ <p>I revert when I'm dropped</p>
+</div>
+
+<div id="draggable2" class="ui-widget-content">
+ <p>I revert when I'm not dropped</p>
+</div>
+
+<div id="droppable" class="ui-widget-header">
+ <p>Drop me here</p>
+</div>
+
+</body>
+</html>