Page 1 of 1

[BBCode] 2Colors Blinking Text

Posted: 15 Jan 2012, 17:40
by all4phone
BBCode Name: 2Colors Blinking Text
Author: all4phone (js script - I do not remember where I found and who is the author of this script, I just adapted and use)

Description: This BBCode allows you to display blinking text in two chosen (by user) different colors. Also user can choose the time of blinking for each color.
Version: 0.0.2

Author Notes: Each bbcode must have a different id ({NUMBER1}) !
BBCode works in browsers such as: IE, Opera, FF, Chrome.

How to use BBCode:

Code: Select all

[blink={NUMBER1},{COLOR1},{NUMBER2},{COLOR2},{NUMBER3}]{INTTEXT}[/blink]
HTML code:

Code: Select all

    <script type="text/javascript">
        // <![CDATA[

    function blink(id, color, time, color2, time2)
    {
    if (document.getElementById)
    {
    document.getElementById(id).style.color = color;
    setTimeout('blink("' + id + '","' + color2 + '",' + time2 + ',"' + color + '",' + time + ')', time);
    }
    else if (document.all)
    {
    document.all[id].style.color = color;
    setTimeout('blink("' + id + '","' + color2 + '",' + time2 + ',"' + color + '",' + time + ')', time);
    }
    }
    // ]]>
        </script>
    <div id="blink{NUMBER1}">{INTTEXT}</div>
    <script type="text/javascript">
        // <![CDATA[
    blink("blink{NUMBER1}", "{COLOR1}", {NUMBER2}, "{COLOR2}", {NUMBER3});
    // ]]>
        </script>
Help line:

Code: Select all

[blink=ID,color1,time1,color2,time2]text[/blink]

Example:

Code: Select all

[blink=1,blue,2000,purple,2000]2Colors Blinking Text[/blink]
Demo: Demo topic
Demo Username: tester
Demo Password: 123456

[BBCode] 2Colors Blinking Text

Posted: 15 Jan 2012, 19:55
by master412160
It works sweet!

Is it possible to add a third color?