jsPlumb endpoints offset problem

939 views
Skip to first unread message

Sonali Dubey

unread,
Dec 8, 2012, 2:59:33 PM12/8/12
to jsp...@googlegroups.com
Hi,

I have a setup where I have a parent container with position as relative. 
When I create new elements into this parent element, the endpoints are not properly attached..they are shifted a bit like this:

But if I change the parent container's position as absolute, the endpoints render perfectly.

Am I missing something here?

Thanks!

Sonali Dubey

unread,
Dec 8, 2012, 3:05:29 PM12/8/12
to jsp...@googlegroups.com
Just a Update,
All the endpoints have a ._jsPlumb_endpoint class.
So I changed the margin to -10px and it worked. But I am not sure if this hack is appropriate. Suggestions?

Simon Porritt

unread,
Dec 9, 2012, 7:15:26 PM12/9/12
to jsp...@googlegroups.com
It sounds like you've got a margin set on some element.  jQuery's offset function doesn't take margins into account, and jsPlumb uses that function to determine the location of the elements in the UI.

Sonali Dubey

unread,
Dec 12, 2012, 5:25:32 AM12/12/12
to jsp...@googlegroups.com
oh...yep I was applying a border and this caused the problem..
Thanks for the help!

Wojciech Makowiecki

unread,
Jun 1, 2013, 8:22:54 PM6/1/13
to jsp...@googlegroups.com
So, is there any way of having (at the parent element) 
border-top-width and 
border-left-width 

set to anything higher then 0px
and avoiding the shift ?

BTW, 
border-right-width and border-bottom-width 
don't couse the shift and setting any of the margins doesn't hurt either.
Reply all
Reply to author
Forward
0 new messages