是的,所以我一直在玩 jsPlumb。假设我有一个有两个端点的 div;一个顶部中心,一个底部中心。
创建新连接时,我可以使用下面的函数绑定到该事件。我的问题是,如何获得端点的锚位置?我确实获得了 Source 和 TargetEndpoint 对象,但查看文档,我没有找到获取锚点位置的方法...
thanks!
jsPlumb.bind("jsPlumbConnection", function(connectionInfo) {
/*
connection : the new Connection. you can register listeners on this etc.
sourceId : id of the source element in the Connection
targetId : id of the target element in the Connection
source : the source element in the Connection
target : the target element in the Connection
sourceEndpoint : the source Endpoint in the Connection
targetEndpoint : the targetEndpoint in the Connection
*/
});
connectionInfo.connection.endpoints[0].anchor.type
是源位置。connectionInfo.connection.endpoints[1].anchor.type
是目标位置。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)