【发布时间】:2012-12-10 21:47:35
【问题描述】:
http://jsfiddle.net/doktormolle/dNXVx/
如何让这个动画自动生成?
我对这一切都很陌生,因此非常感谢任何帮助!
function fx(o)
{
var $o=$(o);
$o.html($o.text().replace(/([\S])/g,'<span>$1</span>'));
$o.css('position','relative');
$('span',$o).stop().css({position:'relative',
opacity:0,
fontSize:84,
top:function(i){return Math.floor(Math.random()*500)*((i%2)?1:-1);},
left:function(i){return Math.floor(Math.random()*500)*((i%2)?1:-1);}
}).animate({opacity:1,fontSize:12,top:0,left:0},1000);
}
【问题讨论】:
-
你想自动发生什么?没有点击?像这样 > jsfiddle.net/dNXVx/479
-
看看jQuery的ready方法。
-
@Vega 正是如此,但不重复。谢谢!
标签: javascript jquery animation text