source: [view]
var _t = this;
// validate the cycles counter
if(_t.cycles-0 == _t.cycles && _t.cycles > 0){
// we need to add 1 because we decrement cycles before the animation starts
_t.cycles++;
}else{
_t.cycles = _t.cycles ? -1 : 0;
}
// wire up the mouse hover events
_t._connects = [
d.connect(_t._domNode, "onmouseover", function(){
// temporarily suspend the cycling, but don't officially pause
// it and don't allow suspending if we're transitioning
if(_t.suspendOnHover && !_t.anim && !_t.wfe){
var t = _t._endTime,
n = _t._now();
_t._suspended = true;
_t._resetTimer();
_t._resumeDuration = t > n ? t - n : 0.01;
}
}),
d.connect(_t._domNode, "onmouseout", function(){
// if we were playing, resume playback unless were in the
// middle of a transition
if(_t.suspendOnHover && !_t.anim){
_t._suspended = false;
if(_t.playing && !_t.wfe){
_t.play(true);
}
}
})
];
// everything is ready, so start
if(_t.autoStart && _t.panes.length > 1){
// start playing
_t.play();
}else{
// since we're not playing, lets pause
_t.pause();
}