mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
c15481eeb1
Conflicts: demos/draggable/constrain-movement.html demos/draggable/cursor-style.html demos/draggable/default.html demos/draggable/events.html demos/draggable/handle.html demos/draggable/revert.html demos/draggable/visual-feedback.html demos/droppable/default.html grunt.js tests/unit/draggable/draggable.html tests/unit/draggable/draggable_core.js tests/unit/draggable/draggable_options.js tests/unit/draggable/draggable_test_helpers.js tests/unit/droppable/droppable.html tests/unit/droppable/droppable_options.js ui/draggable.js ui/jquery.ui.droppable.js ui/sortable.js
39 lines
1.3 KiB
HTML
39 lines
1.3 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>jQuery UI Draggable - Delay start</title>
|
|
<link rel="stylesheet" href="../../themes/base/all.css">
|
|
<script src="../../jquery-1.10.2.js"></script>
|
|
<script src="../../ui/core.js"></script>
|
|
<script src="../../ui/widget.js"></script>
|
|
<script src="../../ui/interaction.js"></script>
|
|
<script src="../../ui/draggable.js"></script>
|
|
<link rel="stylesheet" href="../demos.css">
|
|
<style>
|
|
#draggable, #draggable2 { width: 120px; height: 120px; padding: 0.5em; float: left; margin: 0 10px 10px 0; }
|
|
</style>
|
|
<script>
|
|
$(function() {
|
|
$( "#draggable" ).draggable({ distance: 20 });
|
|
$( "#draggable2" ).draggable({ delay: 1000 });
|
|
$( ".ui-draggable" ).disableSelection();
|
|
});
|
|
</script>
|
|
</head>
|
|
<body>
|
|
|
|
<div id="draggable" class="ui-widget-content">
|
|
<p>Only if you drag me by 20 pixels, the dragging will start</p>
|
|
</div>
|
|
|
|
<div id="draggable2" class="ui-widget-content">
|
|
<p>Regardless of the distance, you have to drag and wait for 1000ms before dragging starts</p>
|
|
</div>
|
|
|
|
<div class="demo-description">
|
|
<p>Delay the start of dragging for a number of milliseconds with the <code>delay</code> option; prevent dragging until the cursor is held down and dragged a specifed number of pixels with the <code>distance</code> option. </p>
|
|
</div>
|
|
</body>
|
|
</html>
|