我正在尝试为徽标制作动画。标记如下所示:
<div id="logo">
<h1>
<span>A</span><span>n</span><span>t</span><span>o</span><span>n</span><span>i</span><span>o</span><span>R</span><span>o</span><span>s</span><span>s</span><span>i</span>
</h1>
<h2>composer</h2>
</div>
我要做的是为每个<span>
inside制作淡入效果#logo
。为此,我正在使用以下代码:
function fadeInRecursive (elementToFade) {
if (!elementToFade) {
elementToFade = $('#logo span:first-child')
}
var next = elementToFade.next('#logo span')
if (!next) {return false}
elementToFade.animate({
opacity: 1
}, 3000, fadeInRecursive(next))
}
$(document).ready( fadeInRecursive )
但是 Firefox 崩溃了...
我究竟做错了什么?