第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

如何重新運(yùn)行css3的動(dòng)畫?

如何重新運(yùn)行css3的動(dòng)畫?

如何通過一個(gè)事件(hover,click..)觸發(fā)css3動(dòng)畫的重新執(zhí)行?在stackoverflow找到一個(gè)相關(guān)的問題,但是下面給出的答案也不起作用。http://jsfiddle.net/arunpjohny/8WQcy/1/這篇文章挺好的,介紹了重新運(yùn)行css3動(dòng)畫的不同方法animation必須是infinite,animation-play-state才有效。restart用這種方法挺好://retrievetheelementelement=document.getElementById("logo");//resetthetransitionby...element.addEventListener("click",function(e){e.preventDefault;//->removingtheclasselement.classList.remove("run-animation");//->triggeringreflow/*Theactualmagic*///withoutthisitwouldn'twork.Tryuncommentingthelineandthetransitionwon'tberetriggered.element.offsetWidth=element.offsetWidth;//->andre-addingtheclasselement.classList.add("run-animation");},false);
查看完整描述

2 回答

?
慕桂英4014372

TA貢獻(xiàn)1871條經(jīng)驗(yàn) 獲得超13個(gè)贊

為何不用animationend事件,這個(gè)也很好做兼容
el.addEventListener('click',function(){
this.classList.add('active');
this.addEventListener('animationend',function(){
this.classList.remove('active');
});
});
                            
查看完整回答
反對 回復(fù) 2019-04-19
  • 2 回答
  • 0 關(guān)注
  • 367 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)