0

Hello,

I have two paragraphs on my page and I need to draw a line between them. Now, I currently store the positions of the two paragraphs inside a database and I have access to them, I just don't know what to do from here. Some people have suggested I subtract certain values and then multiply.

Basically:

<p> 1:

position_x (top) : 38
position_x (left): 341

<p>2: 

position_x (top) :181
position_x (left): 597

Now to calculate the distance someone suggested something like this:

var algorith1 = $node1X - $node2Y;
var algorith2 = $node1Y - $node2X;

var final = $algorith1*$algorith2;

But then how would I draw a line? I'm not using canvass either, just jQuery/Javascript.

Anyone shed any help on this?

Thanks :)

2
Contributors
5
Replies
6
Views
5 Years
Discussion Span
Last Post by vsmash
0

It would draw a black line in between two paragraphs.
"I have two paragraphs on my page and I need to draw a line between them. "

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.