nightsider Posted August 7, 2009 Share Posted August 7, 2009 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 More sharing options...
justsomeguy Posted August 7, 2009 Share Posted August 7, 2009 You can add CSS rules to the div that holds your content to change anything about the content in that div. Link to comment Share on other sites More sharing options...
nightsider Posted August 7, 2009 Author Share Posted August 7, 2009 how do i do that i assume it would go in here <div id="contentToWrite" style="display:none" text-decoration:"overline" class="tip"> ive experimented with some options like text-color="red" but nothing happens Link to comment Share on other sites More sharing options...
justsomeguy Posted August 7, 2009 Share Posted August 7, 2009 It's just "color". All CSS rules go in the style attribute, that text-decoration is in the wrong place. Link to comment Share on other sites More sharing options...
nightsider Posted August 7, 2009 Author Share Posted August 7, 2009 It's just "color". All CSS rules go in the style attribute, that text-decoration is in the wrong place.can you give me an example and where shoud the text decoration go? Link to comment Share on other sites More sharing options...
justsomeguy Posted August 7, 2009 Share Posted August 7, 2009 Everything goes in the style attribute.<div id="contentToWrite" style="display:none; text-decoration: overline; color: red;" class="tip"> Link to comment Share on other sites More sharing options...
nightsider Posted August 7, 2009 Author Share Posted August 7, 2009 added color: red; to the style div but the text color is still back Link to comment Share on other sites More sharing options...
justsomeguy Posted August 10, 2009 Share Posted August 10, 2009 You must be doing something wrong. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.