Drag commands
I.dragTo
Drags an element to another target element
Usage
I.dragTo(element, target);
Parameters
Parameter | Type | Remarks |
---|---|---|
element | string | Keyword to identify the element to drag. |
target | string | Keyword to identify the target element to drop on. |
Example(s)
Drag elements using labels
I.goTo("http://jqueryui.com/resources/demos/droppable/default.html")
I.dragTo("drag me", "drop here")
Drags the element "drag me" to the target element "drop here".
Drag elements using CSS
I.goTo("http://jqueryui.com/resources/demos/droppable/default.html")
I.dragTo("#draggable", "#droppable")
Drags the element with the ID "draggable" to the target element with the ID "droppable".
I.dragBy
Drags an element directionally by (x,y) pixels right and down.
Usage
I.dragBy(element, x, y);
Parameters
Parameter | Type | Remarks |
---|---|---|
element | string | Keyword to identify the element to drag. |
x | number | Number of pixels to drag right. Use negative numbers to drag left instead. |
y | number | Number of pixels to drag down. Use negative numbers to drag up instead. |
Example(s)
I.goTo("http://jqueryui.com/resources/demos/droppable/default.html")
I.dragBy("drag me", 150, 75)
Drags the element "drag me" 150 pixels right, and 75 pixels down.
I.dragUp
Drags an element up by a given number of pixels
Usage
I.dragUp(element, y);
Parameters
Parameter | Type | Remarks |
---|---|---|
element | string | Keyword to identify the element to drag. |
y | number | Number of pixels to drag up. |
Example(s)
I.goTo("http://jqueryui.com/resources/demos/droppable/default.html")
I.dragUp("drag me", 10)
Drags the element "drag me" 10 pixels up.
I.dragDown
Drags an element down by a given number of pixels
Usage
I.dragDown(element, y);
Parameters
Parameter | Type | Remarks |
---|---|---|
element | string | Keyword to identify the element to drag. |
y | number | Number of pixels to drag down. |
Example(s)
I.goTo("http://jqueryui.com/resources/demos/droppable/default.html")
I.dragDown("drag me", 10)
Drags the element "drag me" 10 pixels down.
I.dragLeft
Drags an element left by a given number of pixels
Usage
I.dragLeft(element, x);
Parameters
Parameter | Type | Remarks |
---|---|---|
element | string | Keyword to identify the element to drag. |
x | number | Number of pixels to drag left. |
Example(s)
I.goTo("http://jqueryui.com/resources/demos/droppable/default.html")
I.dragLeft("drag me", 10)
Drags the element "drag me" 10 pixels left.
I.dragRight
Drags an element right by a given number of pixels
Usage
I.dragRight(element, x);
Parameters
Parameter | Type | Remarks |
---|---|---|
element | string | Keyword to identify the element to drag. |
x | number | Number of pixels to drag right. |
Example(s)
I.goTo("http://jqueryui.com/resources/demos/droppable/default.html")
I.dragRight("drag me", 10)
Drags the element "drag me" 10 pixels right.
Test Scripting Tutorial for I.drag Command(s)
This tutorial shows you how to test the slider components in website(s) using the I.drag command.