Baseline Widely available
Die schreibgeschützte transform
-Eigenschaft der SVGClipPathElement
-Schnittstelle spiegelt das transform
-Attribut eines <clipPath>
-Elements wider, das eine Liste von auf das Element angewendeten Transformationen ist.
Ein SVGTransformList
.
html,
body,
svg {
height: 100%;
}
<div>
<svg viewBox="0 0 100 100" width="200" height="200">
<clipPath
id="clip1"
clipPathUnits="objectBoundingBox"
transform="skewX(40) scale(1 0.5)">
<circle cx=".5" cy=".5" r=".35" />
</clipPath>
<rect id="r1" x="0" y="0" width="100" height="100" />
<use clip-path="url(#clip1)" href="#r1" fill="lightblue" />
</svg>
</div>
<pre id="log"></pre>
const translateType = [
"unknown",
"matrix()",
"translate()",
"scale()",
"rotate()",
"skewx()",
"skewy()",
];
const clipPath1 = document.getElementById("clip1");
const log = document.getElementById("log");
let result = "The following transformation have been applied:\n";
for (const transform of clipPath1.transform.baseVal) {
result += `- A transform of type '${translateType[transform.type]}' found.\n`;
}
log.textContent = result;
Spezifikationen Browser-Kompatibilität Siehe auch MDN-Feedback-Box War diese Ãbersetzung hilfreich?
Diese Seite wurde automatisch aus dem Englischen übersetzt.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4