Skip to content

I.dragBy()

Drags an element by a specified horizontal and vertical offset, in pixels.

Usage

js
I.dragBy(element, x: number, y: number)

Parameters

ParameterTypeDescription
elementstringElement to drag — by text, CSS selector, or XPath
xnumberHorizontal distance in pixels. Use negative values to drag left.
ynumberVertical 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.