Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using jsPlumbs, redraw the lines when resizing the window?

Tags:

jquery

jsplumb

I'm struggling with jsplumbs just to do a simple thing. I'm just connecting divs with a single straight line, so how can i redraw the lines when resizing the window? So it always follows the center of the divs. Can i use z-index to put the line below the divs? if i have to connect one div with several other divs, what's the best approach to draw several lines from just one div ?

here is my code so far :

http://jsbin.com/esuvuw/1/edit

Thanks for your help

like image 405
mrbangybang Avatar asked Mar 24 '13 17:03

mrbangybang


1 Answers

Here you are:

  $(window).resize(function(){
      jsPlumb.repaintEverything();
  });

Add this to your code. I just run across this repaintEverything() function and remind of your post.

http://jsbin.com/esuvuw/9/edit to show that this is working.

like image 87
mbochynski Avatar answered Oct 20 '22 20:10

mbochynski