SVGFEDisplacementMapElement: in2 Eigenschaft
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
Die in2
schreibgeschützte Eigenschaft des SVGFEDisplacementMapElement
Interfaces spiegelt das in2
Attribut des gegebenen <feDisplacementMap>
Elements wider.
Wert
Ein SVGAnimatedString
Objekt.
Beispiele
In diesem Beispiel werden zwei <feDisplacementMap>
Elemente in einem Filter definiert, jedes mit einem unterschiedlichen in2
Attribut.
html
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
<defs>
<filter id="filter1">
<!-- First Displacement Map -->
<feDisplacementMap in="SourceGraphic" in2="BackgroundImage" scale="20">
<feFuncR type="table" tableValues="0 1" />
</feDisplacementMap>
<!-- Second Displacement Map -->
<feDisplacementMap in="SourceGraphic" in2="BackgroundImage" scale="30">
<feFuncR type="table" tableValues="0.5 1" />
</feDisplacementMap>
</filter>
</defs>
<rect
x="20"
y="20"
width="100"
height="100"
style="fill:red;"
filter="url(#filter1)" />
<circle cx="100" cy="100" r="50" style="fill:blue;" filter="url(#filter1)" />
</svg>
Wir können auf das in2
Attribut zugreifen:
js
const displacementMaps = document.querySelectorAll("feDisplacementMap");
console.log(displacementMaps[0].getAttribute("in2")); // Output: "BackgroundImage"
console.log(displacementMaps[1].getAttribute("in2")); // Output: "BackgroundImage"
Spezifikationen
Specification |
---|
Filter Effects Module Level 1 # dom-svgfedisplacementmapelement-in2 |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
in2 |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.