I try to apply a bounce vertical effect to my social nav icon using jQuery Easing but I'm not familiar with js and so I need some help.
HTML
<ul class="social">
<li class="facebook"><a class="bounce" href="http://facebook.com"></a></li>
<li class="twitter"><a class="bounce" href="http://twitter.com"></a></li>
</ul>
CSS
ul.social li a {
float: left;
height: 28px;
width: 30px;
display: inline-block;
background: url("http://s14.postimg.org/ufud6x5n1/social.png") no-repeat;
}
ul.social li.facebook a {
background-position: 0 0;
}
ul.social li.twitter a {
background-position: -30px 0;
}
ul.social li.facebook a:hover {
background-position: 0 -28px;
}
ul.social li.twitter a:hover {
background-position: -30px -28px;
}
And here is my problem.
JS
$(document).ready(function() {
$('.bounce').hover( function() {
$(this).animation(1000, "easeOutBounce");
});
});
How can I do to make the background bouncing on mouse hover and then apply a "normal" ease effect on mouse out?
I made a CodePen here
Any help will be much appreciate :) (...and sorry for my not good english)