jsPlumb Draggable with Container Element - How to setup?

547 views Asked by At

How do you set up jsPlumb draggable divs, with a container div?

I have a container positioned relatively, and the divs to be draggable positioned absolutely (this is what the documentation suggestions). The container is 100px from the top of the page. Unless I set margin-top to be -100px for the container, the drag is shifted over by 100px down. How can I fix this?

1

There are 1 answers

0
ajay14 On

Fixed it. I had a padding-top on the body element that caused that very weird error. Takeaway:

  • For draggable to work with jsPlumb, the container element's position should be relative, the draggable elements' position absolute, and any parent elements of the container should not have any padding.