We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b91832e commit 386afd3Copy full SHA for 386afd3
jquery.simulate.js
@@ -279,12 +279,24 @@ function findCenter( elem ) {
279
};
280
}
281
282
+function findCorner( elem ) {
283
+ var offset,
284
+ document = $( elem.ownerDocument );
285
+ elem = $( elem );
286
+ offset = elem.offset();
287
+
288
+ return {
289
+ x: offset.left - document.scrollLeft(),
290
+ y: offset.top - document.scrollTop()
291
+ };
292
+}
293
294
$.extend( $.simulate.prototype, {
295
simulateDrag: function() {
296
var i = 0,
297
target = this.target,
298
options = this.options,
- center = findCenter( target ),
299
+ center = options.handle === "corner" ? findCorner( target ) : findCenter( target ),
300
x = Math.floor( center.x ),
301
y = Math.floor( center.y ),
302
dx = options.dx || 0,
0 commit comments