description |
---|
Learn how to use the I.dragTo command to drag various elements in your UIlicious test. |
Drags an element to another target element
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. |
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".
Drags an element directionally by (x,y) pixels right and down.
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. |
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.
Drags an element up by a given number of pixels
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. |
I.goTo("http://jqueryui.com/resources/demos/droppable/default.html")
I.dragUp("drag me", 10)
Drags the element "drag me" 10 pixels up.
Drags an element down by a given number of pixels
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. |
I.goTo("http://jqueryui.com/resources/demos/droppable/default.html")
I.dragDown("drag me", 10)
Drags the element "drag me" 10 pixels down.
Drags an element left by a given number of pixels
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. |
I.goTo("http://jqueryui.com/resources/demos/droppable/default.html")
I.dragLeft("drag me", 10)
Drags the element "drag me" 10 pixels left.
Drags an element right by a given number of pixels
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. |
I.goTo("http://jqueryui.com/resources/demos/droppable/default.html")
I.dragRight("drag me", 10)
Drags the element "drag me" 10 pixels right.
This tutorial shows you how to test the slider components in website(s) using the I.drag command.