From: Matteo Nastasi (mop) Date: Sat, 19 Apr 2008 16:05:56 +0000 (+0000) Subject: timout management to avoid double animate running on explorer X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=commitdiff_plain;h=61777f564d9c25aeea2542a9f2fdad87b5a4780b;p=brisk.git timout management to avoid double animate running on explorer --- diff --git a/web/ticker.js b/web/ticker.js index 9614087..980261d 100644 --- a/web/ticker.js +++ b/web/ticker.js @@ -159,7 +159,7 @@ train.prototype = { if (this.first == null) { clearTimeout(this.timout); - // this.box.style.visibility = "hidden"; + this.timout = null; } }, @@ -244,20 +244,26 @@ train.prototype = { start: function() { this.resetx(); - this.timout = setTimeout(function(obj){ obj.animate(); }, this.deltat, this); + if (this.timout == null) { + this.timout = setTimeout(function(obj){ obj.animate(); }, this.deltat, this); + } }, animate: function() { this.box.style.left = (parseInt(this.box.style.left) - this.deltas)+"px"; - if (parseInt(this.box.style.left) >= this.xend) { - this.timout = setTimeout(function(obj){ obj.animate(); }, this.deltat, this); - } - else { - // qui destroy - this.box.style.left = this.anc.offsetWidth+"px"; - this.timout = setTimeout(function(obj){ obj.animate(); }, this.deltat, this); - } + +// if (parseInt(this.box.style.left) >= this.xend) { +// this.timout = setTimeout(function(obj){ obj.animate(); }, this.deltat, this); +// } +// else { +// this.box.style.left = this.anc.offsetWidth+"px"; +// this.timout = setTimeout(function(obj){ obj.animate(); }, this.deltat, this); +// } + if (parseInt(this.box.style.left) < this.xend) { + this.box.style.left = this.anc.offsetWidth+"px"; + } + this.timout = setTimeout(function(obj){ obj.animate(); }, this.deltat, this); }, widthbox_get: function()