JS Draw line between two or more points

本小妞迷上赌 提交于 2019-12-12 22:28:31

问题


i need to draw a line between two tags or tags.

Example:
http://caitriona.github.io/connect-the-dots/

I need to do something like this but not like in this script, in an order but randomly.
You can click on "P1" and then on "P2" and the line will be drawn. But if you click on "P1" and then on "P3" an error message should appear (that's not the problem).

My problem is, that I'm not so much a javascript crack to draw the line between the points.

Can someone point me to the right direction?
Thank you!


回答1:


Take a look at drawing in browser SVG (Scalable Vector Graphics). http://www.w3schools.com/graphics/svg_line.asp

You can do some pretty interesting stuff with it. Go through the W3Schools tutorial. Let me know how it goes.



来源:https://stackoverflow.com/questions/17777362/js-draw-line-between-two-or-more-points

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!