List within Lightbox

Sep 9, 2009 at 5:15 PM

I am having trouble getting the dragsort to work when placed within a lightbox.  Using a plugin "colorbox" (http://colorpowered.com/colorbox/), I am loading two lists that I would like to dragsort between.  The actual function of dragsorting works, but when you click and drag an element, it is offset by the colorbox/lightbox's offset within the window.  I have tried to modify the dragsort to figure out the real offset but have had little luck.  Anyone know how I could do this?

Coordinator
Sep 11, 2009 at 11:25 AM

Thanks for raising this issue, the problem is that when the dragged element is positioned absolutely the css left and top will be relative to the parent element that is position absolute which in this case is the colorbox div instead of the document. The solution would be to take the offset of the parent absolute element and take that off the x-y coordinates of the mouse cursor. However, when I do that it doesn't seem to work quite right with colorbox although it works perfectly in a simple test case. However, what does seem to work with colorbox and I don't why is this:

//comment out these two lines in the grabItem function
list.offset.top = e.pageY - list.offset.top;
list.offset.left = e.pageX - list.offset.left;

So give that a go and I might need to dig deeper into what html colorbox generates to see what's going on.