Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  11] [ 7]  / answers: 1 / hits: 44686  / 11 Years ago, fri, january 17, 2014, 12:00:00

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


More From » jquery

 Answers
132

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/


[#73107] Thursday, January 16, 2014, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
leslijessalyng

Total Points: 650
Total Questions: 85
Total Answers: 109

Location: Croatia
Member since Mon, Sep 6, 2021
3 Years ago
leslijessalyng questions
Fri, Feb 21, 20, 00:00, 4 Years ago
Tue, Jul 30, 19, 00:00, 5 Years ago
Fri, Jul 5, 19, 00:00, 5 Years ago
Wed, Mar 13, 19, 00:00, 5 Years ago
;