我想增加/减少和元素的字体,然后是该类的下一个元素等等,对于一组元素<div class="test"></div> <div class="test"></div> ....
。我的意思是如何在jQuery中使用队列动画?
step 1: enlarging the first element and returning to normal size
step 2: enlarging the second element and returning to normal size
....
我的基本代码是
$(document).ready(function() {
$('.test').animate({
left:50,
fontSize: "2em"},
"slow")
.animate({
left:-50,
fontSize: "1em"},
"slow");
这将影响到所有的元素一次。我怎样才能让队列逐一进行更改。一次放大一个元素。
为什么你有两个相同的'animate()'方法链接在一起?我不认为'fontSize'是一个有效的CSS属性。也许你想'font-size'。 – Sparky 2012-04-23 16:55:08
@ Sparky672对不起,这是一个错字。第二个“动画”旨在扭转效应。 – Googlebot 2012-04-23 16:56:47