Jump to content

Need Some Help With Javascript


Recommended Posts

hi all, I'm trying to make a web page and part of the content is a scrolling list, as i don't know javascript at all Ive had to customize a free script.my problem is that i cant change the color of the text in the list, and as a result it blends into the page background and is unreadable.can some one please hep me to change the color of the scrolling list please.

<style type="text/css"><!--#Layer1 {	position:left;	}--></style><center></center><script type="text/javascript">	var charIndex = -1;	var stringLength = 0;	var inputText;	function writeContent(init){		if(init){			inputText = document.getElementById('contentToWrite').innerHTM  L;		}		if(charIndex==-1){			charIndex = 0;			stringLength = inputText.length;		}		var initString = document.getElementById('myContent').innerHTML;		initString = initString.replace(/<SPAN.*$/gi,"");		var theChar = inputText.charAt(charIndex);		   var nextFourChars = inputText.substr(charIndex,4);		   if(nextFourChars=='<BR>' || nextFourChars=='<br>'){			   theChar  = '<BR>';			   charIndex+=3;		   }		initString = initString + theChar + "<SPAN id='blink'>_</SPAN>";		document.getElementById('myContent').innerHTML = initString;		charIndex = charIndex/1 +1;		if(charIndex%2==1){			 document.getElementById('blink').style.display='no  ne';		}else{			 document.getElementById('blink').style.display='in  line';		}		if(charIndex<=stringLength){			setTimeout('writeContent(false)',90);		}else{			blinkSpan();		}	}	var currentStyle = 'inline';	function blinkSpan(){		if(currentStyle=='inline'){			currentStyle='none';		}else{			currentStyle='inline';		}		document.getElementById('blink').style.display = currentStyle;		setTimeout('blinkSpan()',300);	}		msg = "test";msg = " " + msg;pos = 0;function scrollMSG() {document.title = msg.substring(pos, msg.length) + msg.substring(0, pos);pos++;if (pos >  msg.length) pos = 0window.setTimeout("scrollMSG()",200);}scrollMSG();</script><center><table width="572" height="215"><tr><td width="364"><div id="myContent" class="tip"></div><div id="contentToWrite" style="display:none" text-decoration:"overline" class="tip"><br />text 1<br><br /> text 2<br><br /> text 3<br><br /> text 4<br><br />  text 5<br><br /> text 6<br><br />  text 7<br><br /> text 8<br><br />  text 9<br><br />  text 10<br><br />  text 11<br><br /> text 12<br><br /> text 13<br><br /> text 14</div></td></tr></table><table class="listing"><tr><td class="listing"></td></tr></table><p>   </p><p>  <script type="text/javascript">writeContent(true);  </script></p></center>

p.s i dont know javascript so im just customizing a free script to my needs

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...