views:

73

answers:

1

This is an age old problem - but now I'm using scriptaculous its come back to haunt me. When dragging a tree node over other tree nodes I want mouseover to fire for each node I drag over. So I want to position the dragging thing so that its top-left is slightly below and to the right of the mousepointer

can anyone help? - thanks

A: 

Maybe there is an answer in their native code but I couldn't find it.

So I fixed it by adding a plugin. Changed these lines in Draggable.prototype.draw

//  if((!this.options.constraint) || (this.options.constraint=='horizontal'))
//      style.left = p[0] + "px";
//  if((!this.options.constraint) || (this.options.constraint=='vertical'))
//      style.top = p[1] + "px";  

if((!this.options.constraint) || (this.options.constraint=='horizontal'))
    style.left = ((this.options.mouseOffset && point[0]) || p[0]) + "px";
if((!this.options.constraint) || (this.options.constraint=='vertical'))
    style.top = ((this.options.mouseOffset && point[1]) || p[1]) + "px"; 

and when I create the draggable I set my own custom option

mouseOffset: true
plodder