diff options
-rw-r--r-- | demos/draggable/axis.html | 33 | ||||
-rw-r--r-- | demos/draggable/containment.html | 38 | ||||
-rw-r--r-- | demos/draggable/default.html | 26 | ||||
-rw-r--r-- | demos/draggable/grid.html | 31 | ||||
-rw-r--r-- | demos/draggable/index.html | 3 |
5 files changed, 131 insertions, 0 deletions
diff --git a/demos/draggable/axis.html b/demos/draggable/axis.html new file mode 100644 index 000000000..26154961b --- /dev/null +++ b/demos/draggable/axis.html @@ -0,0 +1,33 @@ +<!doctype html>
+<html lang="en">
+<head>
+ <title>jQuery UI Draggable - Constrained to one axis</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>
+ <style type="text/css">
+ .ui-widget-content { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 5px; }
+ #draggable { cursor: n-resize; }
+ #draggable2 { cursor: e-resize; }
+ </style>
+ <script type="text/javascript">
+ $(function() {
+ $("#draggable").draggable({ axis: 'y' });
+ $("#draggable2").draggable({ axis: 'x' });
+ });
+ </script>
+</head>
+<body>
+
+<div id="draggable" class="ui-widget-content">
+ <p>I can be dragged only vertically</p>
+</div>
+
+<div id="draggable2" class="ui-widget-content">
+ <p>I can be dragged only horizontally</p>
+</div>
+
+</body>
+</html>
diff --git a/demos/draggable/containment.html b/demos/draggable/containment.html new file mode 100644 index 000000000..09a6a497a --- /dev/null +++ b/demos/draggable/containment.html @@ -0,0 +1,38 @@ +<!doctype html>
+<html lang="en">
+<head>
+ <title>jQuery UI Draggable - Grid</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>
+ <style type="text/css">
+ .ui-widget-content { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 5px; }
+ </style>
+ <script type="text/javascript">
+ $(function() {
+ $("#draggable").draggable({ containment: 'window' });
+ $("#draggable2").draggable({ containment: 'document' });
+ $("#draggable3").draggable({ containment: 'parent' });
+ });
+ </script>
+</head>
+<body>
+
+<div id="draggable" class="ui-widget-content">
+ <p>I'm contained within the window</p>
+</div>
+
+<div id="draggable2" class="ui-widget-content">
+ <p>I'm contained within the document</p>
+</div>
+
+<div class="ui-widget-content">
+ <p id="draggable3" class='ui-widget-header'>I'm contained within my parent</p>
+</div>
+
+<div style='width: 1px; height: 500px;'></div>
+
+</body>
+</html>
diff --git a/demos/draggable/default.html b/demos/draggable/default.html new file mode 100644 index 000000000..a8c124d20 --- /dev/null +++ b/demos/draggable/default.html @@ -0,0 +1,26 @@ +<!doctype html>
+<html lang="en">
+<head>
+ <title>jQuery UI Draggable - Default Demo</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>
+ <style type="text/css">
+ #draggable { width: 150px; height: 150px; padding: 0.5em; }
+ </style>
+ <script type="text/javascript">
+ $(function() {
+ $("#draggable").draggable();
+ });
+ </script>
+</head>
+<body>
+
+<div id="draggable" class="ui-widget-content">
+ <p>Drag me around</p>
+</div>
+
+</body>
+</html>
diff --git a/demos/draggable/grid.html b/demos/draggable/grid.html new file mode 100644 index 000000000..ec5c9d3d8 --- /dev/null +++ b/demos/draggable/grid.html @@ -0,0 +1,31 @@ +<!doctype html>
+<html lang="en">
+<head>
+ <title>jQuery UI Draggable - Grid</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>
+ <style type="text/css">
+ .ui-widget-content { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 5px; }
+ </style>
+ <script type="text/javascript">
+ $(function() {
+ $("#draggable").draggable({ grid: [20,20] });
+ $("#draggable2").draggable({ grid: [1,50] });
+ });
+ </script>
+</head>
+<body>
+
+<div id="draggable" class="ui-widget-content">
+ <p>I can be dragged in a 20x20 grid system</p>
+</div>
+
+<div id="draggable2" class="ui-widget-content">
+ <p>I only follow a vertical 50 pixel grid</p>
+</div>
+
+</body>
+</html>
diff --git a/demos/draggable/index.html b/demos/draggable/index.html index e68d32cc4..f1548ccaa 100644 --- a/demos/draggable/index.html +++ b/demos/draggable/index.html @@ -9,6 +9,9 @@ <dl class="demos-nav"> <dt>Draggable</dt> <dd><a href="default.html">Default</a></dd> + <dd><a href="axis.html">Axis</a></dd> + <dd><a href="grid.html">Grid</a></dd> + <dd><a href="containment.html">Containment</a></dd> </dl> </body> |