I have this issue with getting an animation working only if the user hovers over a div.
I made a jsfiddle: http://jsfiddle.net/HBfLY/1/
So I want it to bounce in from the left, but instead it is blinking. What I am doing wrong?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The problem you’re experiencing is that, once the element changes its position due to the animation, it’s no longer hovered-over by the cursor, therefore the
:hoverselector no longer applies.To remedy this you could apply the
:hoverto an ancestor element:JS Fiddle demo.
Or use a preceding sibling element:
JS Fiddle demo.
In those browsers that support the general-sibling combinator, you could use any preceding sibling element (so long as you can target it with CSS, and, to reiterate, that this sibling precedes the element to be targeted in the DOM):
JS Fiddle demo.
References:
~combinator.