两个SVG元素触摸时的事件 [英] Event when two SVG elements touch

查看:343
本文介绍了两个SVG元素触摸时的事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用任何方法在SVG中是否可以调用即使两个特定元素接触?或者我要编码很长的路要走,弄清楚他们的边界是否接触到复杂的数学?

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 complicated maths?

推荐答案

在SVG 1.1 DOM中用于交叉点处理的最外层SVG元素上可用的方法:

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

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

不幸的是,我认为跨浏览器支持这些方法是直到不好。

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

这篇关于两个SVG元素触摸时的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆