Syn.move(
{
from: "0x0",
to: "100x100"
},
document.document)
Element Coordinates
If jQuery is present, you can pass an element as the from or to option
and the coordinate will be set as the center of the element.
Syn.move(
{
from: $(".recipe")[0],
to: $("#trash")[0]
},
document.document)
Query Strings
If jQuery is present, you can pass a query string as the from or to option.
Syn.move(
{
from: ".recipe",
to: "#trash"
},
document.document)
No From
If you don't provide a from, the element argument passed to Syn is used.
Syn.move(
{ to: "#trash" },
'myrecipe')
Relative
You can move the drag relative to the center of the from element.
Syn.move("+20 +30", "myrecipe");
Syn.move(options, from, callback) -> undefined
{Object}
options to configure the drag
{HTMLElement}
the element to move
{Function}
a callback that happens after the drag motion has completed
Moves the cursor from one point to another.
Quick Example
The following moves the cursor from (0,0) in the window to (100,100) in 1 second.
Options
There are many ways to configure the endpoints of the move.
PageX and PageY
If you pass pageX or pageY, these will get converted to client coordinates.
String Coordinates
You can set the pageX and pageY as strings like:
Element Coordinates
If jQuery is present, you can pass an element as the from or to option and the coordinate will be set as the center of the element. Syn.move( { from: $(".recipe")[0], to: $("#trash")[0] }, document.document)
Query Strings
If jQuery is present, you can pass a query string as the from or to option.
Syn.move( { from: ".recipe", to: "#trash" }, document.document)
No From
If you don't provide a from, the element argument passed to Syn is used.
Relative
You can move the drag relative to the center of the from element.