PDA

View Full Version : JavaScript on Xanga



luckyvictor
03-25-2007, 07:13 PM
I am new to here. If anything I have done wrong please forgive me.

I have got a JavaScript code which I would like to put it into my xanga. However, it didn't work, but I had tested the code and it does work definitely fine. So would anyone tell me please what's wrong with it? and what should I do so it can work on my Xanga Please?

I am new to here. If anything I have done wrong please forgive me.

I have got a JavaScript code which I would like to put it into my xanga. However, it didn't work, but I had tested the code and it does work definitely fine. So would anyone tell me please what's wrong with it? and what should I do so it can work on my Xanga Please?

<div id="fade" style="text-align:center; width:200px; height:30px; margin-top:200px; margin-left: 50px;"></div>
<script type="text/javascript">
<!--
function fadetext() {
fade.style.filter="alpha(opacity="+x+", style=0)";
x=((y<50)?x+2:x-2); y+=1;
if(y==100) {
z=Math.floor(Math.random() * texts.length); y=0;
fade.innerHTML=texts[z]; fade.style.color=tcolor[z];
}

setTimeout("fadetext();", 100);
}
var texts=new Array(9), tcolor=new Array(9), x=0, y=0, z=1;
texts[1]="aaa";
texts[2]="bbb";
texts[3]="ccc";
texts[4]="ddd";
texts[5]="eee";
texts[6]="fff";
texts[7]="ggg";
texts[8]="hhh";
texts[9]="iii";


tcolor[1]="#ffffff";
tcolor[2]="#ffffff";
tcolor[3]="#ffffff";
tcolor[4]="#ffffff";
tcolor[5]="#ffffff";
tcolor[6]="#ffffff";
tcolor[7]="#ffffff";
tcolor[8]="#ffffff";
tcolor[9]="#ffffff";

fade.innerHTML=texts[z]; fade.style.color=tcolor[z];
window.onload=fadetext;
//--></script>