| Date: Friday, 2009-03-27, 3:47 PM
Message # 1 |
STEP 1: Copy and paste the code below so that it sits between the <head> and </head> tags at the top of your web-page: Quote <script type="text/javascript"> // <![CDATA[ var speed=100; // speed colours change, 1 second = 1000 var raincol=new Array("#ff0000", "#ff9900", "#ffff00", "#99ff00", "#00ff00", "#00ff99", "#00ffff", "#0099ff", "#0000ff", "#9900ff", "#ff00ff", "#ff0099"); // change the colours if you want to var alink="http://www.mf2fm.com/rv"; // page to link text to (set to ="" for no link) /**************************** * Rainbow Text Effect * *© 2003-6 mf2fm web-design* * http://www.mf2fm.com/rv * * DON'T EDIT BELOW THIS BOX * ****************************/ var rainbow, raintxt, raincnt=0; window.onload=function() { if (document.getElementById) { var i, raini; rainbow=document.getElementById("rainbow"); raintxt=rainbow.firstChild.nodeValue; while (rainbow.childNodes.length) rainbow.removeChild(rainbow.childNodes[0]); for (i=0; i<raintxt.length; i++) { raini=document.createElement("span"); raini.setAttribute("id", "rain"+i); raini.appendChild(document.createTextNode(raintxt.charAt(i))); if (alink) { raini.style.cursor="pointer"; raini.onclick=function() { top.location.href=alink; } } rainbow.appendChild(raini); } rainbow=setInterval ("raining()", speed); }} function raining() { for (var i=0; i<raintxt.length; i++) document.getElementById("rain"+i).style.color=raincol[(i+raincnt)%raincol.length]; raincnt++; } // ]]> </script> STEP 2: Place a <span> element with 'id="rainbow"' on your web-page containing the text you wish to be turned into a rainbow. For example: Quote <span id="rainbow">RAINBOW TEXT</span>
This user has not applied a signature yet.
HTML code to this post |
|
BB-code to this post |
|
Direct link to this post |
|
Message edited by manHunt - Friday, 2009-03-27, 3:48 PM |
|