【发布时间】:2011-10-21 13:28:32
【问题描述】:
t.grow = function(parent,evt) {
evt.target.Y = 0
var r = parent.radius, that = this
this.loop = function() {
parent.root.suspendRedraw(10000)
evt.target.Y = evt.target.Y - 6
evt.target.setAttribute('transform',
'translate(' + 0 + ',' + evt.target.Y + ')')
r = r + 0.1
evt.target.setAttribute('r',r)
parent.root.unsuspendRedrawAll()
if(evt.target.Y < parent.timeout) {
clearInterval(that.timer)
}
}
that.timer = window.setInterval(this.loop,30)
}
this.el.addEventListener("mouseover",
function(event){
t.grow(parent,event)
},
true)
我真的需要一些关于上述动画的帮助。
目前动画是在对象的鼠标悬停时触发的,但我真正想要实现的不是动画被触发的事件,而是我希望它在随机时间触发的事件
【问题讨论】:
标签: javascript animation canvas svg