Jump to content
xisto Community
Sign in to follow this  
web_designer

Rainbow Effect To Your Text?just Try And See

Recommended Posts

Rainbow Effect to your text…just try and see

 

 

 

You can add effect to the text (headlines or titles) by using java scripts, it will colors the words with a rainbow color, Just put this code in the body tag and you can edit it as you like, enjoy

 

 

 

 

<p align="center"><font size="6" face="Tahoma"><strong><script  language="JavaScript">     <!--     function createHexArray(n)  {     this.length=n;     for (var i=1; i<=n; i++)        this[i]=i-1;        this[11]="A";     this[12]="B";     this[13]="C";     this[14]="D";     this[15]="E";     this[16]="F";        return this;  }        hx = new createHexArray(16);        function convertToHex(x)  {     var high=x/16;     var s=high+"";     s=s.substring(0,2);     high=parseInt(s,10);     var left=hx[high+1];     var low=x-high*16;     s=low+"";     s=s.substring(0,2);     low=parseInt(s,10);     var right=hx[low+1];     var string=left+""+right;     return string;  }     function makeRainbow(text)  {     text=text.substring(3,text.length-4);     color_d1=255;     mul=color_d1/text.length;     for(i=0;i < text.length;i++)     {        color_d1=255*Math.sin(i/(text.length/3)); "255*Math.sin(i/(text.length/3))"        color_h1=convertToHex(color_d1);        color_d2=mul*i;        color_h2=convertToHex(color_d2);        document.write("<FONT COLOR=\"#FF"+color_h1+color_h2+"\">"+text.substring(i,i+1)+"</FONT>");     }  }  //-->  </script>   <!--You may edit these font tags.--> </strong></font><font size="6"><strong><script  language="JavaScript"><!--  // You may edit the message below.     {makeRainbow("<< your text must be here >> ");}   // --></script></strong></font></p>

Notice from rvalkass:

Code should go inside Code tags.


Share this post


Link to post
Share on other sites

Its not a very peasant rainbow effect with such big of a code... i would use a plug-in for your cms or something. I dont even know something that i would want to use a rainbow effect on....

Share this post


Link to post
Share on other sites

Wow that's pretty nicehttp://forums.xisto.com/no_longer_exists/ <----the code in action without edits.


thank you soviet rathe for your cooperation with me. i am glad that you find my post interesting and also thank you for the link. in fact i should do that but it isn't pass in my mind. also i can tell that this effect very useful for designers that deals with codes and don't want to use images to make certain word colors. as you know images are beautiful but takes time to make it (especially if you want to professional) and we should deal with browsers bugs to set it correctly. instead we can simply use this effect, we will get our page loads faster without using images. we don't have to deal with browser bugs.we can use it in different places (headings, titles, or notes if we want to attract the visitor to a certain area in our websites).

Share this post


Link to post
Share on other sites

you didn't misspell "bla", once! i am proud of you!

actually, i think you should enter a paragraph instead of less than 1 line of text to allow others to see the full effect. just a suggestion if you plan on keeping that page up and since you already posted a link to it

Wow that's pretty nicehttp://forums.xisto.com/no_longer_exists/ <----the code in action without edits.


Share this post


Link to post
Share on other sites

hey soviet nice demo bla xD and for the author, the code is so big and long but yes it works :D thanks for this one I can use this in some of my projects in school aha thanks again :) hope you create more styles in text using a js

Share this post


Link to post
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
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.