Skip to content

Commit dc94bbf

Browse files
committed
Draggable: Don't use computed style for top and left of position:relative elements. Fixes #5537 - Draggable: position relative draggable jumps on first drag in Opera
1 parent 49f8c1c commit dc94bbf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ui/jquery.ui.draggable.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,8 @@ $.widget("ui.draggable", $.ui.mouse, {
305305
if(this.cssPosition == "relative") {
306306
var p = this.element.position();
307307
return {
308-
top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
309-
left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
308+
top: p.top - (parseInt(this.helper[0].style.top,10) || 0) + this.scrollParent.scrollTop(),
309+
left: p.left - (parseInt(this.helper[0].style.left,10) || 0) + this.scrollParent.scrollLeft()
310310
};
311311
} else {
312312
return { top: 0, left: 0 };

0 commit comments

Comments
 (0)