Using jsPlumbs, redraw the lines when resizing the window?

mrbangybang picture mrbangybang · Mar 24, 2013 · Viewed 6.9k times · Source

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

Answer

mbochynski picture mbochynski · Apr 9, 2013

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.