From: Dave W. <dw...@ck...> - 2000-10-29 13:50:18
|
I am using the dynapi to make a fade script in which an array of text is faded in a layer. The whole idea is that one array holds a list of texts to move through and another is the corrisponding link. I want to make a layer that holds the text and another right on top of it that holds a transperent gif and the link so that it appears that the whole thing is clickable. I have it mostly working in netscape but IE does not seem to fade. It seems to blast right through the routine and just show the last text and color. Another wierd "feature" is that the link is not available until the fading is done. Thanks in advance for any help. Dave Waller here is a link with the script in action: http://www.ckhnet.com/users/dwaller/test/test.html and here is the script // editable variables var fontSize = 2 var fontFace = "" var fontStyle = "" var textXpos = 50 var textYpos = 50 var textWidth = 350 var textHeight = 80 var fadeSpeed = 3 var textBg = "white" var textFg = "red" var fadeText = new Array() var fadeHref = new Array() var FadeStart = "CCCCCC" var fadeEnd = "FFFFFF" fadeText[0] = "This is the first text This is the first text This is the first text This is the first text This is the first text" fadeHref[0] = "blank1.html" fadeText[1] = "This is the second text This is the second text This is the second text This is the second text This is the second text" fadeHref[1] = "blank2.html" fadeText[2] = "This is the third text" fadeHref[2] = "blank3.html" // end of editable variables // DO NOT EDIT BELOW THIS var hexBase= new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"); var loopTimer = new Array var hex is.ns = (document.layers)? true:false is.ie = (document.all)? true:false function loopText(numText){ var text = "" var linkText = "<a href=\"" + fadeHref[numText] + "\" target=\'_top\'><img src=\"pic.gif\" width=" + textWidth + " height=" + textHeight + "></a>" if (is.ns) { linkLayer.write(linkText) } else { document.all['linkLayerDiv'].innerHTML = linkText } var hexStartR = FadeStart.substr(0,2) var hexStartG = FadeStart.substr(2,2) var hexStartB = FadeStart.substr(4,2) var color = new Array( hexStartR, hexStartG ,hexStartB ) //alert(numText) for ( c = 0; c < 3; c++ ){ for ( hex1 in hexBase ) { for ( hex2 in hexBase ) { if ( hexBase[hex1] + "" + hexBase[hex2] > color[c] ){ color[c] = hexBase[hex1] + "" + hexBase[hex2] colorBase = color[0] + color[1] + color[2] text = "<table width=130> <tr><td><font color=\"#" + colorBase + "\">" + fadeText[numText] + " " + colorBase + "</font></td></tr></table>" if (is.ns){ textLayer.write(text) } else { document.all['linkLayerDiv'].innerHTML = text } } } } } } function startItUp(){ DynLayerInit() textLayer = new DynLayer("textLayerDiv") linkLayer = new DynLayer("linkLayerDiv") for ( x = 0; x < fadeText.length ; x++ ){ loopText(x) } } |