Skip to content
Permalink
Browse files

demos: first bunch of draggable demos (default, axis, grid, containment)

  • Loading branch information
Paul Bakaus
Paul Bakaus committed Dec 30, 2008
1 parent 84e9175 commit fae9c64bd96ba8e87fe413ef450ed9f3a61f454d
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>

0 comments on commit fae9c64

Please sign in to comment.
You can’t perform that action at this time.