Animate.css: Animate on Hover?

Created on 5 Mar 2014  路  2Comments  路  Source: animate-css/animate.css

Animate.css works just fine (great project, btw!)

However, I'm curious about utilizing it to only animate on hover.

I have tried adding a class I thought would work, however it is not.

.animatedhover:hover {
  -webkit-animation-duration: 1s;
  animation-duration: 1s;
  -webkit-animation-fill-mode: both;
  animation-fill-mode: both;
}
<span class="icon animatedhover bounce"></span>

Let it be noted that regular animated class works fine.

<span class="icon animated bounce"></span>

Most helpful comment

Try removing the Animate.css classes from your element and give it this styling instead:

.icon:hover {
    -webkit-animation: bounce 1s;
    animation: bounce 1s;
}

All 2 comments

You need to use animation-play-state property.

.animatedhover {
  ...
  animation-play-state: paused;
}
.animatedhover:hover {
  animation-play-state: running;
}

Try removing the Animate.css classes from your element and give it this styling instead:

.icon:hover {
    -webkit-animation: bounce 1s;
    animation: bounce 1s;
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

joetidee picture joetidee  路  4Comments

rodrigo-fonseca picture rodrigo-fonseca  路  4Comments

asangadev picture asangadev  路  3Comments

nzamosenchuk picture nzamosenchuk  路  4Comments

phlegx picture phlegx  路  5Comments