Jquery 如何使用链接的动画css?

Jquery 如何使用链接的动画css?,jquery,html,css,Jquery,Html,Css,我正在尝试使用animate.css <link rel="stylesheet" href="animate.css" type='text/css'> 和HTML: <a class="yo">yo</a> yo 然后是Jquery: <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script> $(doc

我正在尝试使用animate.css

<link rel="stylesheet" href="animate.css" type='text/css'>
和HTML:

<a class="yo">yo</a>
yo
然后是Jquery:

<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>

$(document).ready(function(){ 
$(".yo").click(function() {
         $(this).addClass('animated wobble');
});
});

$(文档).ready(函数(){
$(“.yo”)。单击(函数(){
$(this.addClass('animated wobble');
});
});

但是,当我单击
yo
时,它会更改类(因此我知道jquery正在工作),但什么也没有发生。我还向css添加了一个类,并更改了字体颜色,它工作正常(因此我知道链接工作正常),但单击时仍然没有抖动动画?

我相信您需要指定调用哪个动画。尝试将其添加到动画类:

.animated {
   -webkit-animation-name: wobble;
   -moz-animation-name: wobble;
   -o-animation-name: wobble;
   animation-name: wobble;
}
Wobble不是类名,它只是动画的名称,因此可以删除jQuery中的Wobble addClass

编辑:看起来我没有阅读你所有的CSS。试着移动你的手
.animated.wobble{}
部分就在
.animated{}
部分的正下方。

但他在CSS中为元素定义了
动画名称
,元素的类同时包含
animated
wobble
(两者都是用jQuery添加的)。@DavidThomas:噢,我的错了。我一定没有在css中向下滚动足够远。我猜是新手犯的错误你确定样式表正在加载吗?是的,100%确定!我在这方面试过
.animated {
   -webkit-animation-name: wobble;
   -moz-animation-name: wobble;
   -o-animation-name: wobble;
   animation-name: wobble;
}