Appearance
I.dragBy()
Drags an element by a specified horizontal and vertical offset, in pixels.
Usage
js
I.dragBy(element, x: number, y: number)Parameters
| Parameter | Type | Description |
|---|---|---|
element | string | Element to drag — by text, CSS selector, or XPath |
x | number | Horizontal distance in pixels. Use negative values to drag left. |
y | number | Vertical distance in pixels. Use negative values to drag up. |
Example
Drag an element by a fixed offset
js
I.goTo("http://jqueryui.com/resources/demos/droppable/default.html")
I.dragBy("drag me", 150, 75)Drags the element "drag me" 150 pixels to the right and 75 pixels down.