www.webdeveloper.com
Results 1 to 4 of 4

Thread: Flashing link font color while onmouseover

  1. #1
    Join Date
    Nov 2004
    Location
    Vancouver
    Posts
    24

    Flashing link font color while onmouseover

    I have a function which could change hypelink's font color while onmouseover and stops when mouseout.

    If i want to apply it to my while page's link or other page's link,
    Do I have to type onmouseover and onmouseout before each link?
    DO I have to place the function to each link?

    Is there a effecient way to do that?
    Need help buddy!!!

    My code is here:

    var lcolor = new Array(24);
    lcolor[0]="#FF5050"
    lcolor[1]="#FF6600"
    lcolor[2]="#FF9933"
    lcolor[3]="#FFCC00"
    lcolor[4]="#FFFF00"
    lcolor[5]="#CCFF33"
    lcolor[6]="#99FF33"
    lcolor[7]="#66FF33"
    lcolor[8]="#33CC33"
    lcolor[9]="#00FF00"
    lcolor[10]="#00FF99"
    lcolor[11]="#00FFCC"
    lcolor[12]="#33CCCC"
    lcolor[13]="#00CCFF"
    lcolor[14]="#0099FF"
    lcolor[15]="#0066FF"
    lcolor[16]="#3366FF"
    lcolor[17]="#6666FF"
    lcolor[18]="#9966FF"
    lcolor[19]="#CC33FF"
    lcolor[20]="#FF00FF"
    lcolor[21]="#FF33CC"
    lcolor[22]="#FF3399"
    lcolor[23]="#FF0066"
    var rate = 0;
    var stoper = 1;


    function flashing()
    {
    if (stoper=0)
    {
    rate++;

    if(rate >= 24)
    {
    rate = 0;
    flashing();
    }

    else
    {
    document.alinkColor =lcolor[rate];
    document.vlinkColor =lcolor[rate];
    document.linkColor =lcolor[rate];
    setTimeout("flashing()", 350);
    }
    }

    else
    {
    return;
    }

    }

    function stop
    {
    stoper=1;
    document.alinkColor="#FFFFFF";
    document.vlinkColor ="#FFFFFF";
    document.linkColor ="#FFFFFF";


    }

  2. #2
    Join Date
    Nov 2002
    Location
    Nashua, NH
    Posts
    3,195
    Learning CSS would be the first step in finding a better and much simpler approach...

  3. #3
    Join Date
    Dec 2004
    Location
    Toronto, Canada
    Posts
    124
    Place all of your links 'in' that code and it'll work for all of them.

    Leave it open ended and it'll work for any link on the page.

  4. #4
    Join Date
    Nov 2004
    Location
    Vancouver
    Posts
    24
    What do you mean by leave it open?

    I am a newbie of doing javascript and css. Can anyone tell me how to do such thing by css?

    Can anyone provide an example.

    Thanks guys

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles