mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Draggable demo: Updated visual-feedback demo.
This commit is contained in:
parent
a1d312b3ed
commit
7e7e79adb9
@ -7,23 +7,21 @@
|
||||
<script src="../../jquery-1.7.1.js"></script>
|
||||
<script src="../../ui/jquery.ui.core.js"></script>
|
||||
<script src="../../ui/jquery.ui.widget.js"></script>
|
||||
<script src="../../ui/jquery.ui.mouse.js"></script>
|
||||
<script src="../../ui/jquery.ui.interaction.js"></script>
|
||||
<script src="../../ui/jquery.ui.draggable.js"></script>
|
||||
<link rel="stylesheet" href="../demos.css">
|
||||
<style>
|
||||
#draggable, #draggable2, #draggable3, #set div { width: 90px; height: 90px; padding: 0.5em; float: left; margin: 0 10px 10px 0; }
|
||||
.ui-draggable { width: 90px; height: 90px; padding: 0.5em; float: left; margin: 0 10px 10px 0; }
|
||||
#draggable, #draggable2, #draggable3 { margin-bottom:20px; }
|
||||
#set { clear:both; float:left; width: 368px; height: 120px; }
|
||||
p { clear:both; margin:0; padding:1em 0; }
|
||||
</style>
|
||||
<script>
|
||||
$(function() {
|
||||
$( "#draggable" ).draggable({ helper: "original" });
|
||||
$( "#draggable2" ).draggable({ opacity: 0.7, helper: "clone" });
|
||||
$( "#draggable" ).draggable();
|
||||
$( "#draggable2" ).draggable({ helper: true });
|
||||
$( "#draggable3" ).draggable({
|
||||
cursor: "move",
|
||||
cursorAt: { top: -12, left: -20 },
|
||||
helper: function( event ) {
|
||||
helper: function() {
|
||||
return $( "<div class='ui-widget-header'>I'm a custom helper</div>" );
|
||||
}
|
||||
});
|
||||
@ -42,11 +40,11 @@
|
||||
</div>
|
||||
|
||||
<div id="draggable2" class="ui-widget-content">
|
||||
<p>Semi-transparent clone</p>
|
||||
<p>Cloned helper</p>
|
||||
</div>
|
||||
|
||||
<div id="draggable3" class="ui-widget-content">
|
||||
<p>Custom helper (in combination with cursorAt)</p>
|
||||
<p>Custom helper</p>
|
||||
</div>
|
||||
|
||||
<h3 class="docs">Stacked:</h3>
|
||||
@ -69,8 +67,7 @@
|
||||
|
||||
|
||||
<div class="demo-description">
|
||||
<p>Provide feedback to users as they drag an object in the form of a helper. The <code>helper</code> option accepts the values 'original' (the draggable object moves with the cursor), 'clone' (a duplicate of the draggable moves with the cursor), or a function that returns a DOM element (that element is shown near the cursor during drag). Control the helper's transparency with the <code>opacity</code> option.</p>
|
||||
<p>To clarify which draggable is in play, bring the draggable in motion to front. Use the <code>zIndex</code> option to set a higher z-index for the helper, if in play, or use the <code>stack</code> option to ensure that the last item dragged will appear on top of others in the same group on drag stop.</p>
|
||||
<p>Provide feedback to users as they drag an element in the form of a helper. The <code>helper</code> option accepts the values false/null (the draggable element moves with the cursor), true (a clone of the draggable moves with the cursor), or a function that returns a DOM element or jQuery object (that element is shown near the cursor during drag).</p>
|
||||
</div><!-- End demo-description -->
|
||||
|
||||
</body>
|
||||
|
Loading…
Reference in New Issue
Block a user