Event when two SVG elements touch

前端 未结 2 1187
予麋鹿
予麋鹿 2020-12-17 18:01

Is it possible in SVG, using any method, to call an even if two specific elements touch? Or would I have to code the long way, and figure out if their borders touch with com

2条回答
  •  时光说笑
    2020-12-17 18:34

    There are actually four methods available on the outermost SVG element for intersection handling in the SVG 1.1 DOM:

    1. getIntersectionList
    2. getEnclosureList
    3. checkIntersection
    4. checkEnclosure

    Unfortunately I think the cross-browser support for these methods is still not great.

提交回复
热议问题