I had the same problem and found that all this was because of a bootstrap navbar "navbar-fixed-top" class with position to fixed, that move down my <body>
60px lower than <html>
top. So when I was moving draggable forms in my site, the cursor appeared 60px on top of form.
You can see that in Chrome debugging tool, in the Elements interface, click on the <body>
tag and you will see a gap between top and the body.
Since I'm using this navbar all over my applications and didn't want to modify my initializing call to drag (as per DarthJDG's procedure) for each forms. I decided to extend draggable widget this way and simply add a yOffset in my draggable initialisation.
(function($) {
$.widget("my-ui.draggable", $.ui.draggable, {
_mouseDrag: function(event, noPropagation) {
//Compute the helpers position
this.position = this._generatePosition(event);
this.positionAbs = this._convertPositionTo("absolute");
//Call plugins and callbacks and use the resulting position if something is returned
if (!noPropagation) {
var ui = this._uiHash();
if(this._trigger('drag', event, ui) === false) {
this._mouseUp({});
return false;
}
this.position = ui.position;
}
// Modification here we add yoffset in options and calculation
var yOffset = ("yOffset" in this.options) ? this.options.yOffset : 0;
if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top-yOffset+'px';
if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
return false;
}
});
})(jQuery);
Now when I initialize the draggable element/form in a site using bootstrap navbar:
// Make the edit forms draggable
$("#org_account_pop").draggable({handle:" .drag_handle", yOffset: 60});
Of course, you will have to experiment to determine the right yOffset as per your own site.
Thanks anyway to DarthJDG who pointed me the right direction. Cheers!