基本上我想使用JQuery来操作页面加载时的CSS。正确的语法添加CSS与JQuery的其他属性
我要添加这个CSS:
animation: drawcircle 1.5s 2
如何打破长达通过jQuery CSS重视?
.css ("animation", "Drawcircle 1.5s 2")
?
基本上我想使用JQuery来操作页面加载时的CSS。正确的语法添加CSS与JQuery的其他属性
我要添加这个CSS:
animation: drawcircle 1.5s 2
如何打破长达通过jQuery CSS重视?
.css ("animation", "Drawcircle 1.5s 2")
?
有2种方式要么根据您的需要使用课堂切换或手动。
// The class toggle style
// JS
element.classList.add("animate"); // to start
element.classList.remove("animate"); // to stop
// css
thelement.animate {
animation: drawcircle 1.5s 2;
}
OR
// jQuery
$(element).addClass("animate"); // to start
$(element).removeClass("animate"); // to stop
// css
thelement.animate {
animation: drawcircle 1.5s 2;
}
OR
// the manual style
// JS
element.style.animation = "drawcircle 1.5s 2";
OR
// jQuery
$(element).css("animation", "spin 1.5s infinite");
希望帮助
你可以做类似如下:
element.css('animation-name', 'drawcircle');
element.css('animation-duration', '4s');
凡
画圆
是您在@keyframes定义中定义的动画。
下面是如何得出纯CSS的圆,例如: Draw a circle with pure CSS
可以使用面具元件在例如启动动画,如:
mask.css('animation-play-state', 'running');