jquery-ui/ui/tests/autodrag.html

68 lines
1.3 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<title>Draggable - Automated Test Page</title>
<script type="text/javascript" src="../../jquery/jquery-1.2.6.js"></script>
<script type="text/javascript" src="../../ui/source/ui.core.js"></script>
<script type="text/javascript" src="../../ui/source/ui.draggable.js"></script>
<script type="text/javascript" src="ui.testmouse.js"></script>
<style type="text/css">
html, body { height: 100%; }
#main { height: 100%; }
.drag { position: relative; margin: 10px; padding: 10px; border: 3px solid black; cursor: move; width: 200px; height: 40px; background: #eef; }
</style>
<script type="text/javascript">
</script>
<script type="text/javascript">
$(function() {
$(".drag").draggable().testMouse({
speed: "fast"
});
$('#begin').click(function(e) {
$("#status").text("Running...");
$(".drag:eq(0)").testMouse("drag", 100, 0, function() {
$('#status').text("Ready");
});
});
});
</script>
</head>
<body>
<div id="main">
<h1>jQuery UI Draggable - Automated Test</h1>
Status: <span id="status">Ready</span>
<div style="height: 3em;"><button id="begin">Run Test</button></div>
<div class="drag">
Drag 1
</div>
<div class="drag">
Drag 2
</div>
<div class="drag">
Drag 3
</div>
</div>
</body>
</html>