I’m creating somekind of flowchart builder on JS. I need an advice about how can I make two blocks (divs) connected with an arrow or line.
Look at the example below
______
| |
| DIV x----------------
| | |
-------- |
|
__x___
| |
| DIV2 |
| |
--------
Divs are dragable so the connection have to be dynamic. Can you help me guys with it?
Cheers
Just an idea;
Think the lines as a div also. Lets say it is divLine. divLine should have the background-color of the page. Then you can assign borders. So that it will seem like a line.
Whenever a user drags the other div, you check the X and Y values anyway. According to those values, resize your divLines’s height,width and position. Probably you will have to change border values also.
Of course HTML 5 is the much better solution but it is not working in every browser.