home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC-Online 1999 November
/
PCOnline_11_1999.iso
/
home
/
fader.js
next >
Wrap
Text File
|
1998-11-11
|
3KB
|
123 lines
NS4 = (document.layers) ? 1 : 0;
IE4 = (document.all) ? 1 : 0;
semi = ";";
sp = " ";
styleStr = "<STYLE TYPE='text\/css'>"
+ "#elAll {"
+ "position:relative;"
+ "width:" + boxWid + semi
+ "height:" + boxHgt + semi
+ "background-color:" + backCol + semi
+ "layer-background-color:" + backCol + semi
+ "clip:rect(0 "+ boxWid + sp + boxHgt + " 0)" + semi
+ "}"
+ "#elNews {"
+ "position:absolute;"
+ "height:" + boxHgt + semi
+ "background-color:" + backCol + semi
+ "layer-background-color:" + backCol + semi
+ "clip:rect(0 "+ boxWid + sp + boxHgt + " 0)" + semi
+ "}"
+ "#elGif {position:absolute}"
+ "#elNoDHTML {position:absolute; visibility:hidden}"
+ "A.newslink {"
+ "text-decoration:"+ txtDec + semi
+ "text-align:"+ txtAln + semi
+ "color:"+ HLfntCol + semi
+ "font-size:"+ fntSiz + semi
+ "font-weight:"+ fntWgh + semi
+ "font-style:"+ fntSty + semi
+ "font-family:"+ fntFam + semi
+ "line-height:"+ linHgt + semi
+ "}"
+ "A.newslink:hover {"
+ "color:"+ HLhovCol + semi
+ "}"
+ "P.newsTXT {"
+ "text-align:"+ txtAln + semi
+ "color:"+ fntCol + semi
+ "font-size:"+ fntSiz + semi
+ "font-weight:"+ fntWgh + semi
+ "font-style:"+ fntSty + semi
+ "font-family:"+ fntFam + semi
+ "line-height:"+ linHgt + semi
+ "}"
+ "<\/STYLE>";
document.write(styleStr);
finite = (maxLoops > 0) ? 1 : 0;
slideInt = (blendDur/(boxHgt/slideInc))*1000;
arNews = new Array();
for (i=0; i<arURL.length; i++) {
arNews[i] = new Array(3);
arNews[i][0] = prefix + arURL[i];
arNews[i][1] = arHL[i];
arNews[i][2] = arTXT[i];
}
window.onload = initIt;
function initIt(){
if (NS4) {
if (!document.elAll) return;
elAll = document.elAll;
elNews = elAll.document.elNews;
elGif = elAll.document.elGif;
imStr = "<IMG SRC='fade.gif' HEIGHT="+boxHgt+" WIDTH="+boxWid+">"
elGif.document.write(imStr);
elGif.document.close();
}
else {
elNews.style.filter = "blendTrans(duration=" + blendDur + ")";
}
newsCount = 0;
if (finite) loopCount = 0;
doIt();
blendTimer = setInterval("doIt()",blendInt*1000)
}
function doIt() {
if (finite && loopCount==maxLoops) {
clearInterval(blendTimer);
return;
}
if (NS4) elGif.top = 0;
newsStr = "<A CLASS=newslink "
+ "HREF=" + arNews[newsCount][0] + ">"
+ arNews[newsCount][1] +
"<p class=newsTXT>" + arNews[newsCount][2] + "</p></A>"
if (NS4) {
with (elNews.document) {
write(newsStr);
close();
}
}
else {
elNews.filters.blendTrans.Apply();
elNews.innerHTML = newsStr;
elNews.filters.blendTrans.Play();
}
newsCount++;
if (newsCount == arNews.length) {
newsCount=0;
if (finite) loopCount++;
}
if (NS4) slideIt();
}
function slideIt(){
elGif.top += slideInc;
if (elGif.top >= boxHgt) return;
setTimeout("slideIt()",slideInt);
}