aboutsummaryrefslogtreecommitdiffstats
path: root/demos/droppable
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
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')
-rw-r--r--demos/droppable/index.html1
-rw-r--r--demos/droppable/revert.html47
2 files changed, 48 insertions, 0 deletions
diff --git a/demos/droppable/index.html b/demos/droppable/index.html
index f969f49e9..3cec15189 100644
--- a/demos/droppable/index.html
+++ b/demos/droppable/index.html
@@ -15,6 +15,7 @@
<li><a href="activeclass.html">activeClass</a></li>
<li><a href="greedy.html">greedy</a></li>
<li><a href="tolerance.html">tolerance</a></li>
+ <li><a href="revert.html">revert</a></li>
</ul>
</div>
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>