我的情况是,我的网页上有动态生成的 asp Imagebuttons
。当我单击一个 ImageButton
时,我会看到另一个动态创建的与其相关的 ImageButton
(关系在数据库中维护)。现在,当我单击任何 Imagebutton
时,我需要在单击的 ImageButton
和显示在网页上的相关 Imagebuttons
之间画一条线。由于我正在使用 Web 应用程序而不是 Windows 应用程序,因此我无法访问绘图库。那么有没有什么方法可以使用javascript或jquery来绘制线条。这里的所有点击事件,Imagebuttons
都是动态的。
最佳答案
有很多选择:
http://jsbin.com/enime3/1/edit
http://raphaeljs.com/
http://www.amaslo.com/2012/06/drawing-diagonal-line-in-htmlcssjs-with.html
关于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?
关于c# - 需要在网页上的两点之间画一条线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13449062/