b0y-101 Mini Shell


Current Path : E:/www/advanced-mba/javascripts/
File Upload :
Current File : E:/www/advanced-mba/javascripts/report.js

var Report = Class.create({
  initialize: function(name) {
  	if (name) this.name = name;
  	this.container = $(this.name);
  	this.length = this.container.getElementsByTagName('li').length;
	this.timer;
	this.duration = 6000;
	
	this.timer = setTimeout(this.next.bindAsEventListener(this), this.duration);
  },
  
  lineHeight: 30,
  index: 0,

  next: function(){
  	if (this.index == this.length) this.index = 0;
  	var target = $(this.name + '-contatiner');
  	var targety = this.index * this.lineHeight;
  	new Effect.Move(target, { x: 0, y: -targety, mode: 'absolute', duration: 0.5 });
  	this.index++;
  	this.timer = setTimeout(this.next.bindAsEventListener(this), this.duration);
  }  
});

Copyright © 2019 by b0y-101