Today I tried to implement in my site animate.css
But I wanted to make sure that the 'effect is activated in the: hover So I used jquery for this
The code is :
$(".questo").hover( function (e) {
$(this).toggleClass('animated shake', e.type === 'mouseenter');
});
The problem is that once you remove the mouse, the 'effect is interrupted. It could land the 'effect even without hover effect once it has begun?
Thank you all in advance
What is a CSS hover animation? A CSS hover animation occurs when a user hovers over an element, and the element responds with motion or another transition effect. It's used to highlight key items on a web page and it's an effective way to enhance your site's interactivity.
Transition on Hover. CSS transitions allows you to change property values smoothly (from one value to another), over a given duration. Add a transition effect (opacity and background color) to a button on hover: Fade in on hover:
Instead of use toggleClass, change your code by adding the class in hover, and hook for the animation end css3 to finish and than remove the class.
Fade Siblings on Hover 12. Pure CSS Blur Hover Effect 13. Button Hover Effects 14. Glitch Hover Effect 15. Thumbnail Hover Effect
In your CSS file you could just add:
.questo:hover {
-webkit-animation: shake 1s;
animation: shake 1s;
}
The nice thing about this solution is that it requires no JavaScript. For reference look at this page
See this variant (more interactive):
$(".myDiv").hover(function(){
$(this).addClass('animated ' + $(this).data('action'));
});
$(".myDiv").bind("animationend webkitAnimationEnd oAnimationEnd MSAnimationEnd",function(){
$(this).removeClass('animated ' + $(this).data('action'));
});
http://jsfiddle.net/DopustimVladimir/Vc2ug/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With