Cov txheej txheem:

Cov teebmeem hover yog dab tsi?
Cov teebmeem hover yog dab tsi?

Video: Cov teebmeem hover yog dab tsi?

Video: Cov teebmeem hover yog dab tsi?
Video: Teb cov ntseeg tej teebmeem 2024, Kaum ib hlis
Anonim

Hover Effect : Pop thiab Background Animate. Hover effect rau ib yam khoom. Ib daim duab pops nce thiab nqis, thiab tom qab ntawd tus keeb kwm yav dhau slides tawm thiab animate.

Kuj paub, koj ua li cas cov ntawv nyeem tshwm thaum daim duab hovering?

Yuav ua li cas tso saib cov ntawv Animated Tshaj ib daim duab ntawm Hover siv CSS3 nkaus xwb

  1. Tsim HTML¶ Ntxiv koj cov duab siv

    tag thiab ntawv. Ua ntej, koj yuav tsum ntxiv koj cov duab siv lub

    tag.

  2. Tsim CSS¶ Teeb:hover selector. Cov nyhuv ntawm hover yog teem siv: hover pseudo-chav kawm uas xaiv thiab styles lub caij.

Ib tug kuj nug, koj siv hover li cas? Lub:hover selector yog siv los xaiv cov ntsiab lus thaum koj nas hla lawv.

  1. Tswv yim: Tus:hover selector tuaj yeem siv rau ntawm txhua lub ntsiab lus, tsis yog ntawm kev sib txuas nkaus xwb.
  2. Tswv yim: Siv tus:link selector rau style links rau cov nplooj ntawv uas tsis tau mus xyuas, tus: mus xyuas xaiv rau cov kev txuas mus rau cov nplooj ntawv mus xyuas, thiab cov:active selector rau style qhov txuas nquag.

Ntawm no, koj hover ib daim duab hauv CSS li cas?

Teb: Siv CSS keeb kwm yav dhau-duab cuab yeej

  1. Hloov cov duab ntawm Hover hauv CSS
  2. .card {
  3. dav: 130px;
  4. qhov siab: 195px;
  5. keeb kwm: url("images/card-back.jpg") no-repeat;
  6. zaub: inline-block;
  7. }

Yuav ua li cas kom tshem tau ntawm hover?

Txhawm rau lov tes taw cov nyhuv hover, kuv tau txais ob lub tswv yim:

  1. yog tias koj cov nyhuv hover tshwm sim los ntawm JavaScript, tsuas yog siv $. unbind('hover');
  2. yog tias koj hover style yog triggered los ntawm chav kawm, ces tsuas yog siv $. removeClass('hoverCssClass');

Pom zoo: