Name
moveBy( ) — NN 4 IE n/a DOM n/a
Synopsis
moveBy(deltaX,
deltaY)
A convenience method that shifts the location of the current element
by specified pixel amounts along both axes. To shift along only one
axis, set the other value to zero. Positive values for
deltaX shift the element to the right;
negative values to the left. Positive values for
deltaY shift the element downward;
negative values upward. This method comes in handy for path animation
under the control of a setInterval( ) or
setTimeout( ) method that moves the element in a
linear path over time.
Returned Value
None.
Parameters
-
deltaX Positive or negative pixel count of the change in horizontal direction of the element.
-
deltaY Positive or negative pixel count of the change in vertical direction of the element.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access