X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fticker.js;h=8c73c1ae6fa0c2ef120a7e7ecfd3005de4765fed;hb=d7d8d7998b67bae0996efeebc35c6d3fef84bd09;hp=961408796aff09887d83a2026edb13c70af3b0a3;hpb=4d084be1ca8a753da2bdd7ff84ca244ce2f76a8b;p=brisk.git diff --git a/web/ticker.js b/web/ticker.js index 9614087..8c73c1a 100644 --- a/web/ticker.js +++ b/web/ticker.js @@ -49,19 +49,21 @@ train.prototype = { box: null, notebox: null, width: 0, - deltat: 100, - deltas: 5, + deltat: 250, + deltas: 12, xend: 0, timout: null, + clickable: true, show: function() { + this.clickable = true; this.box.style.visibility = "visible"; }, hide: function() { - this.box.style.visibility = "hidden"; + this.clickable = false; for (cur = this.first ; cur != null ; cur = cur.next) { if (cur.notebox != null) { cur.cb_mouseout(); @@ -159,7 +161,7 @@ train.prototype = { if (this.first == null) { clearTimeout(this.timout); - // this.box.style.visibility = "hidden"; + this.timout = null; } }, @@ -195,7 +197,7 @@ train.prototype = { wag.box.innerHTML = ""; wag.shut_step = 2; } - curw = wag.widthbox_get() - 4; + curw = wag.widthbox_get() - 10; wag.w = curw + 2; // 2 for border pixels if (curw <= 0) { obj.box.removeChild(wag.box); @@ -209,7 +211,7 @@ train.prototype = { } } this.redraw(); - setTimeout(function(){ arguments[0][0].shut_wagon(arguments[0]); }, 100, [ obj, wag ]); + setTimeout(function(){ arguments[0][0].shut_wagon(arguments[0]); }, 250, [ obj, wag ]); }, redraw: function() @@ -244,20 +246,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() @@ -355,7 +363,9 @@ wagon.prototype = { cb_click: function() { - act_sitdown(this.table); + if (this.anc.clickable == true) { + act_sitdown(this.table); + } }, cb_mouseover: function()