简体   繁体   中英

storing and retrieving corrdinates using jsPlumb

I want to use jsPlumb (with jquery) to create a family tree type program. I want the nodes to be draggable and I know that jsPlumb can do that for you. However, after the nodes are dragged around and repositioned I want to give the user the ability to save his changes and exact layout will be saved. I will need to get the coordinates of each element and store them in a database and then use that data to recreate the page. How can I do this in the most efficient way?

You could use absolute positioning and retrieve the elements positions with jQuery:

var pos = $(yournode).position();
var top = pos.top;
var left = pos.left;

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