From: Maggie Costello Wachs Date: Thu, 15 Jan 2009 21:57:33 +0000 (+0000) Subject: completed reorganization of draggable demos X-Git-Tag: 1.6rc5~14 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c1447173c659c78e036b5c4c6bc91de26e84a13b;p=jquery-ui.git completed reorganization of draggable demos --- diff --git a/demos/demos.css b/demos/demos.css index 708f02164..a70565546 100644 --- a/demos/demos.css +++ b/demos/demos.css @@ -188,7 +188,10 @@ div.demo { font-family: "Trebuchet MS", "Arial", "Helvetica", "Verdana", "sans-serif"; } +#demo-frame div.demo h3 { clear:left; font-size:12px; font-weight:normal; padding:0 0 1em; margin:0; } + div.demo-description { + clear:both; padding:12px; font-family: "Trebuchet MS", "Arial", "Helvetica", "Verdana", "sans-serif"; font-size: 1.3em; diff --git a/demos/draggable/constrain-movement.html b/demos/draggable/constrain-movement.html index fbfea8009..997c50af2 100644 --- a/demos/draggable/constrain-movement.html +++ b/demos/draggable/constrain-movement.html @@ -1,43 +1,65 @@ - jQuery UI Draggable - Axis Demo + jQuery UI Draggable - Constrain movement
+ +

Constrain movement along an axis:

-
+

I can be dragged only vertically

-
+

I can be dragged only horizontally

- +

or to within another DOM element:

+
+
+

I'm contained within the box

+
+ +
+

I'm contained within the box's parent

+
+ +
+

I'm contained within my parent

+
+

-Define the boundaries of the draggable area. Set the axis option to limit the draggable's path to the x- or y-axis. Or use the containment option to specify a parent DOM element or a jQuery selector, like 'document.' +Constrain the movement of each draggable by defining the boundaries of the draggable area. Set the axis option to limit the draggable's path to the x- or y-axis, or use the containment option to specify a parent DOM element or a jQuery selector, like 'document.'

diff --git a/demos/draggable/containment_iframe.html b/demos/draggable/containment_iframe.html index c9eafdd11..7416afb10 100644 --- a/demos/draggable/containment_iframe.html +++ b/demos/draggable/containment_iframe.html @@ -8,7 +8,8 @@ + + + + + + + +
+ +
+

I will always stick to the center (relative to the mouse)

+
+ +
+

My cursor is at left -5 and top -5

+
+ +
+

My cursor position is only controlled for the 'bottom' value

+
+ +
+ +
+ +

+Position the cursor while dragging the object. By default the cursor appears in the center of the dragged object; use the cursorAt option to specify another location relative to the draggable (specify a pixel value from the top, right, bottom, and/or left). +

+ +
+ + diff --git a/demos/draggable/default.html b/demos/draggable/default.html index b7425819c..0c219d58d 100644 --- a/demos/draggable/default.html +++ b/demos/draggable/default.html @@ -1,7 +1,7 @@ - jQuery UI Draggable - Default Demo + jQuery UI Draggable - Default functionality @@ -29,7 +29,7 @@

-The easiest way to make an element draggable. Hold down the mouse and drag it around. +Enable draggable functionality on any DOM element. Move the draggable object by clicking on it with the mouse and dragging it anywhere within the viewport.

diff --git a/demos/draggable/delay-start.html b/demos/draggable/delay-start.html new file mode 100644 index 000000000..66d3e4893 --- /dev/null +++ b/demos/draggable/delay-start.html @@ -0,0 +1,41 @@ + + + + jQuery UI Draggable - Delay start + + + + + + + + + +
+ +
+

Only if you drag me by 20 pixels, the dragging will start

+
+ +
+

Regardless of the distance, you have to drag and wait for 1000ms before dragging starts

+
+ +
+ +
+ +

+Delay the start of dragging for a number of milliseconds with the delay option; prevent dragging until the cursor is held down and dragged a specifed number of pixels with the distance option. +

+ +
+ + diff --git a/demos/draggable/events.html b/demos/draggable/events.html index 98f2065a3..8d836bdbc 100644 --- a/demos/draggable/events.html +++ b/demos/draggable/events.html @@ -1,7 +1,7 @@ - jQuery UI Draggable - Events Demo + jQuery UI Draggable - Events @@ -65,7 +65,7 @@

- +Layer functionality onto the draggable using the start, drag, and stop events. Start is fired at the start of the drag; drag during the drag; and stop when dragging stops.

diff --git a/demos/draggable/handle.html b/demos/draggable/handle.html index ea53c09b8..bbaf3431b 100644 --- a/demos/draggable/handle.html +++ b/demos/draggable/handle.html @@ -1,19 +1,20 @@ - jQuery UI Draggable - Handle Demo + jQuery UI Draggable - Handles @@ -24,15 +25,19 @@

I can be dragged only by this handle

+
+

You can drag me around…

+

…but you can't drag me by this handle.

+
+
-

- -

+

Allow dragging only when the cursor is over a specific part of the draggable. Use the handle option to specify the jQuery selector of an element (or group of elements) used to drag the object.

+

Or prevent dragging when the cursor is over a specific element (or group of elements) within the draggable. Use the cancel option to specify a jQuery selector over which to "cancel" draggable functionality.

diff --git a/demos/draggable/index.html b/demos/draggable/index.html index d4c927193..e5eef219a 100644 --- a/demos/draggable/index.html +++ b/demos/draggable/index.html @@ -13,7 +13,7 @@
  • Events
  • Constrain movement
  • Delay start
  • -
  • Snap to grid or element
  • +
  • Snap to element or grid
  • Auto-scroll
  • Revert position
  • Visual feedback
  • diff --git a/demos/draggable/revert.html b/demos/draggable/revert.html index 7a43c4f46..15d452020 100644 --- a/demos/draggable/revert.html +++ b/demos/draggable/revert.html @@ -1,7 +1,7 @@ - jQuery UI Draggable - Revert Demo + jQuery UI Draggable - Revert position @@ -33,7 +33,7 @@

    - +Return the draggable (or it's helper) to its original location when dragging stops with the boolean revert option.

    diff --git a/demos/draggable/scroll.html b/demos/draggable/scroll.html index 371cec747..f94dd6609 100644 --- a/demos/draggable/scroll.html +++ b/demos/draggable/scroll.html @@ -1,7 +1,7 @@ - jQuery UI Draggable - Scroll Demo + jQuery UI Draggable - Auto-scroll @@ -40,7 +40,7 @@

    - +Automatically scroll the document when the draggable is moved beyond the viewport. Set the scroll option to true to enable auto-scrolling, and fine-tune when scrolling is triggered and its speed with the scrollSensitivity and scrollSpeed options.

    diff --git a/demos/draggable/snap-to.html b/demos/draggable/snap-to.html index 0f9c9a91d..9d8a26b91 100644 --- a/demos/draggable/snap-to.html +++ b/demos/draggable/snap-to.html @@ -1,14 +1,14 @@ - jQuery UI Draggable - Snap Demo + jQuery UI Draggable - Snap to element or grid @@ -17,8 +17,8 @@ $("#draggable").draggable({ snap: true }); $("#draggable2").draggable({ snap: '.ui-widget-header' }); $("#draggable3").draggable({ snap: '.ui-widget-header', snapMode: 'outer' }); - $("#draggable4").draggable({ snap: '.ui-widget-header', snapMode: 'inner' }); - $("#draggable5").draggable({ snap: '.ui-widget-header', snapTolerance: 50 }); + $("#draggable4").draggable({ grid: [20,20] }); + $("#draggable5").draggable({ grid: [80, 80] }); }); @@ -31,36 +31,33 @@
    -
    +

    Default (snap: true), snaps to all other draggable elements

    -
    +

    I only snap to the big box

    -
    +

    I only snap to the outer edges of the bix box

    -
    -

    I only snap to the inner edges of the big box

    +
    +

    I snap to a 20 x 20 grid

    -
    -

    I also snap to the big box but I'm very sticky because I have a high tolerance

    +
    +

    I snap to a 80 x 80 grid

    - - -
    -

    - -

    +

    Snap the draggable to the inner or outer boundaries of a DOM element. Use the snap, snapMode (inner, outer, both), and snapTolerance (distance in pixels the draggable must be from the element when snapping is invoked) options.

    + +

    Or snap the draggable to a grid. Set the dimensions of grid cells (height and width in pixels) with the grid option.

    diff --git a/demos/draggable/sortable.html b/demos/draggable/sortable.html index 2649807b7..459434e09 100644 --- a/demos/draggable/sortable.html +++ b/demos/draggable/sortable.html @@ -1,7 +1,7 @@ - jQuery UI Draggable - Sortable Demo + jQuery UI Draggable + Sortable @@ -45,7 +45,7 @@

    - +Draggables are built to interact seamlessly with sortables.

    diff --git a/demos/draggable/visual-feedback.html b/demos/draggable/visual-feedback.html index 333560567..23e342e92 100644 --- a/demos/draggable/visual-feedback.html +++ b/demos/draggable/visual-feedback.html @@ -1,19 +1,22 @@ - jQuery UI Draggable - Helper Demo + jQuery UI Draggable - Visual feedback
    +

    With helpers:

    +

    Original

    -

    Clone

    +

    Semi-transparent clone

    Custom helper (in combination with cursorAt)

    - +

    Stacked:

    +
    +
    +

    We are draggables..

    +
    + +
    +

    ..whose z-indexes are controlled automatically..

    +
    + +
    +

    ..with the stack option.

    +
    +
    -

    - -

    +

    Provide feedback to users as they drag an object in the form of a helper. The helper 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 opacity option.

    + +

    To clarify which draggable is in play, bring the draggable in motion to front. Use the zindex option to set a higher z-index for the helper, if in play, or use the stack option to ensure that the last item dragged will appear on top of others in the same group on drag stop.