2017-08-29 53 views

回答

1

有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"); 

希望帮助

1

你可以做类似如下:

element.css('animation-name', 'drawcircle'); 
element.css('animation-duration', '4s'); 

画圆

是您在@keyframes定义中定义的动画。

下面是如何得出纯CSS的圆,例如: Draw a circle with pure CSS

可以使用面具元件在例如启动动画,如:

mask.css('animation-play-state', 'running');