<feBlend>
<feColorMatrix>
<feComponentTransfer>
<feComposite>
<feConvolveMatrix>
<feDiffuseLighting>
<feDisplacementMap>
<feDistantLight>
<feFlood>
<feFuncA>
<feFuncB>
<feFuncG>
<feFuncR>
<feGaussianBlur>
<feImage>
<feMerge>
<feMergeNode>
<feMorphology>
<feOffset>
<fePointLight>
<feSpecularLighting>
<feSpotLight>
<feTile>
<feTurbulence>
<filter>
<font>
<font-face>
<font-face-format>
<font-face-name>
<font-face-src>
<font-face-uri>
<foreignObject>
pointer-events
attribute is a presentation attribute that allows defining whether or when an element may be the target of a mouse event.
注意:
As a presentation attribute
pointer-events
can be used as a CSS property.
You can use this attribute with the following SVG elements:
<a>
<circle>
<clipPath>
<defs>
<ellipse>
<foreignObject>
<g>
<image>
<line>
<marker>
<mask>
<path>
<pattern>
<polygon>
<polyline>
<rect>
<svg>
<switch>
<symbol>
<text>
<textPath>
<tspan>
<use>
<svg viewBox="0 0 20 10" xmlns="http://www.w3.org/2000/svg">
<!--
The circle will always intercept the mouse event.
To change the color of the rect underneath you have
to click outside the circle
-->
<rect x="0" y="0" height="10" width="10" fill="black" />
<circle cx="5" cy="5" r="4" fill="white"
pointer-events="visiblePainted" />
<!--
The circle below will never catch a mouse event.
The rect underneath will change color whether you
are clicking on the circle or the rect itself
-->
<rect x="10" y="0" height="10" width="10" fill="black" />
<circle cx="15" cy="5" r="4" fill="white"
pointer-events="none" />
</svg>
window.addEventListener('mouseup', (e) => {
// Let's pick a random color between #000000 and #FFFFFF
const color = Math.round(Math.random() * 0xFFFFFF)
// Let's format the color to fit CSS requirements
const fill = '#' + color.toString(16).padStart(6,'0')
// Let's apply our color in the
// element we actually clicked on
e.target.style.fill = fill
})
| 值 |
bounding-box
|
visiblePainted
|
visibleFill
|
visibleStroke
|
visible
|
painted
|
fill
|
stroke
|
all
|
none
|
|---|---|
| 默认值 |
visiblePainted
|
| Animatable | Yes |
For a detailed explanation of each possible value, have a look at the CSS
pointer-events
文档编制。
BCD tables only load in the browser
最后修改: , 由 MDN 贡献者