My situation here is that, I have asp Imagebuttons
on my web page which are dynamically generated. When I Click on one ImageButton
I see the other dynamically created ImageButtons
which are related to it (Relation is maintained in Database). Now when I clicked on any Imagebutton
I need to draw a line between the clicked ImageButton
and the related Imagebuttons
which get displayed on the web page. As I am working with web application and not windows application I cannot access the drawing library. So is there any way to draw lines using javascript or jquery. Everything here click event, Imagebuttons
are dynamic.
Asked
Active
Viewed 4,028 times
2

Mr_Green
- 40,727
- 45
- 159
- 271
1 Answers
3
There are a lot of options:
http://jsbin.com/enime3/1/edit
http://raphaeljs.com/
http://www.amaslo.com/2012/06/drawing-diagonal-line-in-htmlcssjs-with.html
Similar questions on SO:
How to draw a line between 2 elements using JQuery and refreshing that line?
Easiest way to "draw" simple lines over an image with jQuery and save to Rails DB?
-
thanks a lot. 1 more thing, without clicking the dynamic images can i know the co-ordinates of the imagebuttons(top,Left). On page load my ImageButtons are getting placed on the web page dynamically. So once i find the co-ordinates I can draw a line between them. – Nov 19 '12 at 08:17
-
@AnkurDeshpande take a look at this: http://stackoverflow.com/questions/1002934/jquery-x-y-document-coordinates-of-dom-object or this http://stackoverflow.com/questions/683339/how-do-i-find-the-absolute-position-of-an-element-using-jquery – coder_bro Nov 19 '12 at 09:03