function insert() {
console.log("insert");
if (document.getElementById("temp-id")) return;
const sty = document.createElement("style");
sty.innerHTML = `
* {
animation-duration: 0s !important;
}
`;
sty.id = "temp-id";
document.head.appendChild(sty);
}
function remove() {
try {
document.head.removeChild(document.getElementById("temp-id"));
} catch (e) {
}
}
原生js插入样式文件
猜你喜欢
转载自blog.csdn.net/web_cgh/article/details/85841896
今日推荐
周排行