0
我尝试使用jQuery Easing将弹跳垂直效果应用到我的社交导航图标,但我对js不熟悉,所以我需要一些帮助。使用easing1.3.js弹跳效果到精灵图标
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;
}
这里是我的问题。
JS
$(document).ready(function() {
$('.bounce').hover(function() {
$(this).animation(1000, "easeOutBounce");
});
});
我该怎么做才能使背景弹跳鼠标悬停,然后申请一个鼠标“正常”的缓解作用了呢?
我做了一个CodePen here
任何帮助将是非常赞赏:) (...和抱歉我不好英语)
$(this).animation(1000,“easeOutBounce”});必须是$(this).animation(1000,“easeOutBounce”); – Grumpy
哎呀,对不起,我的错误。我做了更正。我的问题仍然是开放的,但感谢您对Grumpy的评论。 – dragoeco