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 :)

Recommended Answers

All 5 Replies

<p> 1: bla bla bla</p>

<p style="border-top:1px solid black;">
2: bla bla bla</p>

Pardon?

<p> 1: bla bla bla</p>

<p style="border-top:1px solid black;">
2: bla bla bla</p>

How woud that even work?

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. "

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.