2017-08-29 7 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'); 

drawcircle

はあなたが@keyframes定義に定義されたアニメーションです。ここで

は、純粋なCSSで円を描く方法の例です: Draw a circle with pure CSS

あなたが好きなアニメーションを開始するためにその一例ではマスク要素を使用することができます。

mask.css('animation-play-state', 'running'); 
関連する問題