<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<script type="text/javascript">
function rolling(options) {
var self = this;
this.object = document.getElementById(options.rollId);
this.object.onmouseover = function() {
self.stop();
}
;
this.object.onmouseout = function() {
self.play();
}
;
this.delay = options.delay || 1000;
this.speed = options.speed || 50;
this.step = options.step || 1;
this.mover = options.mover || false;
this.elChildHeight = options.childHeight;
this.elHeight = this.object.offsetHeight;
this.elPosition = 0;
this.object.appendChild(this.object.cloneNode(true));
this.control = setTimeout(function() {self.play()}, this.delay);
}
rolling.prototype = {
play:function() {
var self = this, time;
this.elPosition = this.elPosition>(this.mover?this.elHeight:0) ? this.elPosition-this.elHeight : this.elPosition+1;
this.object.style.top = (this.mover ? -this.elPosition : this.elPosition) + "px";
this.control = setTimeout(function() {self.play()}, this.elPosition%(this.elChildHeight*this.step)==0?this.delay:this.speed);
}
,
stop:function() {
clearTimeout(this.control);
}
}
var roll1 = null;
//var roll2 = null;
window.onload = function() {
roll1 = new rolling({rollId: "rollText1", delay: 5000, speed: 10, step: 1, mover: true, childHeight: 27});
//roll2 = new rolling({rollId: "rollText2", delay: 2000, speed: 20, step: 1, mover: false, childHeight: 23});
}
</script>