【发布时间】:2014-08-12 09:47:27
【问题描述】:
我在具有 #box id 的 div 内创建了一个 javascript animation 对象,但我的问题是我无法在函数之外引用动画对象。
http://codepen.io/vincentccw/pen/bfojB?editors=101
这是我的代码:
$('#box').each(function(index, element)
{
var kkc = new TimelineLite({
paused:true
});
kkc.to($("#box") , .4, {left:100,ease:Power1.easeInOut});
element.animation = kkc;
});
$('#box').on('mouseenter', function(){
$('#box').animation.play(); //this doesn't work
});
【问题讨论】:
标签: javascript jquery css object css-animations