开发者

How to get the relative position of a point in a svg element?

开发者 https://www.devze.com 2023-03-01 12:16 出处:网络
I\'m creating a web application where is a svg element. In my Javascript code, I stored the svg container in a variable named \"mySVG\".

I'm creating a web application where is a svg element. In my Javascript code, I stored the svg container in a variable named "mySVG".

How can I get the pointer relative position to the svg element, I mean, X and Y position relative to the Top-Left corner of the svg element, using Javascript so I could display this data on screen while the user performs an action lik开发者_开发知识库e click over a specific point in the svg container?

0

精彩评论

暂无评论...
验证码 换一张
取 消