简体   繁体   中英

jsPlumb Draggable with Container Element - How to setup?

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM