TextSlider = function(className) { document.write("
"); this.item = []; this.width = this.height = this.speed = this.pixel = this.interval = this.size = this.moveCount = this.X = this.Y = 0; this.direction = ""; this.pLayer = document.getElementById("TextSliderPLayer_"+ className); this.layer = document.getElementById("TextSliderLayer_"+ className); this.align = "left"; this.intervalId = null; this.className = className; this.isPause = false; } TextSlider.prototype.init = function() { with (this.pLayer.style) { width = this.width+"px"; height = this.height+"px"; overflow = "hidden"; } with (this.layer.style) { width = this.direction=='up' || this.direction=='down' ? this.width+"px" : this.size*(this.item.length+1)+"px"; height = this.direction=='up' || this.direction=='down' ? this.size*(this.item.length+1)+"px" : this.height+"px"; top = 0; left = 0; position = "relative"; } for (var i=0; i"; if (this.direction=='up' || this.direction=='down') { __html += ""; for (var i in this.item) __html += ""; __html += "
"+this.item[i]+"
"; } else { __html += ""; for (var i in this.item) __html += ""; __html += "
"+this.item[i]+"
"; } __html += ""; this.layer.innerHTML = __html; this.start(); } TextSlider.prototype.start = function() { this.intervalId = setInterval(this.className+".move()", this.speed); } TextSlider.prototype.move = function() { if (this.isPause) return; switch (this.direction) { case "up": this.Y -= this.pixel; break; case "down": this.Y += this.pixel; break; case "left": this.X -= this.pixel; break; case "right": this.X += this.pixel; break; } if (this.direction=='up' || this.direction=='down') { if (Math.abs(this.Y)%this.size==0) this.stop(); this.layer.style.top = this.Y; } else { if (Math.abs(this.X)%this.size==0) this.stop(); this.layer.style.left = this.X; } } TextSlider.prototype.stop = function() { clearInterval(this.intervalId); switch (this.direction) { case "up": if (Math.abs(this.Y) >= parseInt(this.layer.style.height,10)-this.size) this.Y = this.layer.style.top = 0; break; case "down": if (Math.abs(this.Y) <= 0) this.Y = this.layer.style.top = -this.size*(this.item.length-1); break; case "left": if (Math.abs(this.X) >= parseInt(this.layer.style.width,10)-this.size) this.X = this.layer.style.left = 0; break; case "right": if (Math.abs(this.X) <= 0) this.X = this.layer.style.left = -this.size*(this.item.length-1); break; } setTimeout(this.className+".start()", this.interval); } TextSlider.prototype.pause = function() {this.isPause = true;} TextSlider.prototype.unpause = function() {this.isPause = false;} document.write('') document.write('
') var NEWARTICLES = new TextSlider('NEWARTICLES'); NEWARTICLES.item[0] = "
  提升服务效能 推动科学发展...[2008年07月18日]
";NEWARTICLES.item[1] = "
  2008年海珠区自主择业军队...[2008年07月16日]
";NEWARTICLES.item[2] = "
  关于举办第三期专业技术人员继...[2008年07月10日]
";NEWARTICLES.item[3] = "
  发展新党员批复通知书...[2008年07月10日]
";NEWARTICLES.item[4] = "
  批准预备党员转正通知书...[2008年07月10日]
";NEWARTICLES.item[5] = "
  区人事局流动党员支部换届改选...[2008年07月10日]
";NEWARTICLES.item[6] = "
  关于举办吉林大学公共管理专业...[2008年07月03日]
";NEWARTICLES.item[7] = "
  团省委领导到区人才交流服务中...[2008年07月01日]
";NEWARTICLES.item[8] = "
  区人才中心开展“走进社区促就...[2008年06月25日]
";NEWARTICLES.item[9] = "
  6月7日普通话水平测试成绩表...[2008年06月24日]
"; NEWARTICLES.width = 310; NEWARTICLES.height = 25; NEWARTICLES.speed = 35; NEWARTICLES.pixel = 1; NEWARTICLES.interval = 3000; NEWARTICLES.size = 25; NEWARTICLES.direction = 'up'; NEWARTICLES.init(); document.write('
')