svg click事件失效(仅限edge浏览器)

1、重现问题:如果直接在svg绑定click事件,在edge内核中是不灵敏的,在edge内核中只有点击svg边缘部分才会触发click事件 2、解决方法然后在a标签上绑定click事件即可。 3、关于pointer-events: none;介绍 pointer-events: none; Note:如有更好的解决方案请大家一起分享噢 关键字:css, html, html

1、重现问题:



如果直接在svg绑定click事件,在edge内核中是不灵敏的,在edge内核中只有点击svg边缘部分才会触发click事件

2、解决方法





然后在a标签上绑定click事件即可。

3、关于pointer-events: none;介绍
pointer-events: none;

Note:如有更好的解决方案请大家一起分享噢

关键字:css, html, html5, JavaScript