実際にはDOMのメソッドclipPath
が存在しますか?代わりに使用実際にDOMのクリップパスが存在しますか?
setAttribute("style","clip-path: value")
?、
私が使用setAttributeメソッドは、パフォーマンスのために悪いことであると思うので、使いや方法element.style.clipPath
等で容易になります。
function s() {
var i = 100, p = document.getElementById("p");
function f(){
if(i > 0) {
i-= 1;
p.setAttribute("style","clip-path:inset(0 0 0 "+i+"%");
setTimeout(f, 50);
}
}
f();
}
s();
<img width="150" height="150" src="https://i.stack.imgur.com/CE5lz.png" id="p">
だから、 'element.style.clipPath'を試してみたのですか? – epascarello
は存在しません –