-
Notifications
You must be signed in to change notification settings - Fork 0
/
marquee1.js
84 lines (71 loc) · 1.91 KB
/
marquee1.js
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: Mike Hudson :: http://www.afrozeus.com */
function setupFadeLinks() {
arrFadeLinks[0] = "#";
// arrFadeTitles[0] = "Thanks to all contributors for overwhelming response!";
arrFadeTitles[0] = "Testing";
}
// You can also play with these variables to control fade speed, fade color, and how fast the colors jump.
var m_FadeOut = 255;
var m_FadeIn=0;
var m_Fade = 0;
var m_FadeStep = 2;
var m_FadeWait = 500;
var m_bFadeOut = true;
var m_iFadeInterval;
window.onload = Fadewl;
var arrFadeLinks;
var arrFadeTitles;
var arrFadeCursor = 0;
var arrFadeMax;
function Fadewl() {
m_iFadeInterval = setInterval(fade_ontimer, 0);
arrFadeLinks = new Array();
arrFadeTitles = new Array();
setupFadeLinks();
arrFadeMax = arrFadeLinks.length-1;
setFadeLink();
}
function setFadeLink() {
var ilink = document.getElementById("fade_link1");
ilink.innerHTML = arrFadeTitles[arrFadeCursor];
ilink.href = arrFadeLinks[arrFadeCursor];
}
function fade_ontimer() {
if (m_bFadeOut) {
m_Fade+=m_FadeStep;
if (m_Fade>m_FadeOut) {
arrFadeCursor++;
if (arrFadeCursor>arrFadeMax)
arrFadeCursor=0;
setFadeLink();
m_bFadeOut = false;
}
} else {
m_Fade-=m_FadeStep;
if (m_Fade<m_FadeIn) {
clearInterval(m_iFadeInterval);
setTimeout(Faderesume, m_FadeWait);
m_bFadeOut=true;
}
}
var ilink = document.getElementById("fade_link1");
if ((m_Fade<m_FadeOut)&&(m_Fade>m_FadeIn))
ilink.style.color = "#" + ToHex(m_Fade);
}
function Faderesume() {
m_iFadeInterval = setInterval(fade_ontimer, 1);
}
function ToHex(strValue) {
try {
var result= (parseInt(strValue).toString(16));
while (result.length !=2)
result= ("0" +result);
result = result + result + result;
return result.toUpperCase();
}
catch(e)
{
}
}