summaryrefslogtreecommitdiffstats
path: root/usr/local/www/ticker.js
blob: 77d3c635e07d803393134d1c323b7a57e11099b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!--

var width="310px";

var speed=2;
var pauseit=1;

var divonclick=speed=(document.all)? speed : Math.max(1, speed-1);
var copyspeed=speed;
var pausespeed=(pauseit==0)? copyspeed: 0;
var iedom=document.all||document.getElementById;

if (iedom)
	document.write('<span id="marquee-container">'+content+'</span>');

var actualwidth='';
var scroller;

if (window.addEventListener)
	window.addEventListener("load", populatescroller, false);
else if (window.attachEvent)
	window.attachEvent("onload", populatescroller);
else if (document.all || document.getElementById)
	window.onload=populatescroller;

function populatescroller(){
	scroller=document.getElementById? document.getElementById("scroller") : document.all.scroller;
	scroller.style.left=parseInt(width)+8+"px";
	scroller.innerHTML=content;
	document.getElementById("marquee-text");
	actualwidth=document.all? document.getElementById("marquee-text").offsetWidth : document.getElementById("marquee-text").offsetWidth;
	lefttime=setInterval("scrollmarquee()",20);
}

function scrollmarquee(){
	if (parseInt(scroller.style.left)>(actualwidth*(-1)+8))
		scroller.style.left=parseInt(scroller.style.left)-copyspeed+"px";
	else
		scroller.style.left=parseInt(width)+8+"px";
}

if (iedom){
	document.write('<table id="marquee"><td>');
	document.write('<div id="container" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=speed">');
	document.write('<div id="scroller"></div>');
	document.write('</div>');
	document.write('</td></table>');
}

//-->
OpenPOWER on IntegriCloud