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

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

animate.css 不適用于 javascript 中的某些類

animate.css 不適用于 javascript 中的某些類

皈依舞 2024-01-18 14:43:56
請(qǐng)幫助我使用 animate.css 和 javascript(jQuery) 在鼠標(biāo)懸停時(shí)為該元素設(shè)置動(dòng)畫這是我嘗試過的,但不適用于某些課程,例如。 animate__jello超文本標(biāo)記語言 <span onmouseover="add_efect(this)" > Eat </span>JSfunction add_efect(element){  element.classList.add('animate__animated', 'animate__jello');    element.addEventListener('animationend', () => {  element.classList.remove('animate__animated', 'animate__jello');  });}
查看完整描述

1 回答

?
蝴蝶不菲

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

如果您想將<span>元素與 animate.css 一起使用,您需要添加display:inline-block它,或者您可以更改它,<h6>如下所示。


<span>元素?zé)o法使用 animate.CSS 進(jìn)行動(dòng)畫處理。要為它們?cè)O(shè)置動(dòng)畫,您需要為它們提供顯示屬性。


function add_efect(element){

  element.classList.add('animate__animated', 'animate__jello');

  

  element.addEventListener('animationend', () => {

  element.classList.remove('animate__animated', 'animate__jello');

  });

}

<link

    rel="stylesheet"

    href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"

  />


<h6 onmouseover="add_efect(this)">Eat</h6>



<span style='display:inline-block;' onmouseover="add_efect(this)"> Drink </span>



查看完整回答
反對(duì) 回復(fù) 2024-01-18
  • 1 回答
  • 0 關(guān)注
  • 150 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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