Skip to content

Commit fce39f8

Browse files
committed
Drag: Add option x and y to move to specific location
1 parent 779bcef commit fce39f8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

jquery.simulate.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,10 +299,10 @@ $.extend( $.simulate.prototype, {
299299
center = options.handle === "corner" ? findCorner( target ) : findCenter( target ),
300300
x = Math.floor( center.x ),
301301
y = Math.floor( center.y ),
302-
dx = options.dx || 0,
303-
dy = options.dy || 0,
304-
moves = options.moves || 3,
305-
coord = { clientX: x, clientY: y };
302+
coord = { clientX: x, clientY: y },
303+
dx = options.dx || ( options.x !== undefined ? options.x - x : 0 ),
304+
dy = options.dy || ( options.y !== undefined ? options.y - y : 0 ),
305+
moves = options.moves || 3;
306306

307307
this.simulateEvent( target, "mousedown", coord );
308308

0 commit comments

Comments
 (0)