Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    May 2005
    Location
    Alabama
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Netscape how to make cool link

    ok i can't believe i forgot how to do this
    this JS code is supposed to make a link change its background color when you put the mouse over it, the background has to become clearer and clearer as 600 miliseconds pass.... hope you understood MY INGLES NO GOOD .
    I keep on getting the error "object required" would anyone please help??

    Here's the code:

    <html>
    <head><title>Sistema de Navegación 1</title>
    <script language="JavaScript">
    <!--

    function fadeColor(which){
    var thecolors = new Array("#C1DAFF","#77ADFF","#3787FF","#004EC1","#0062F4","#0047B3");
    thenumber = -1;
    if(thenumber<5){
    thenumber += 1;
    document.anchors(which).style.backgroundColor = thecolors[thenumber];
    }
    else{}
    setTimeout('fadeColor('+which+')', 100);
    }
    //-->
    </script>
    </head>
    <body>
    <a href="sistema_navegacion1.html" style="font-family:arial;text-decoration: none;color:black;" name="ellink" onmouseover="fadeColor('ellink')">Link</a>
    </body>
    </html>

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Posts
    525
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Do you mean like the effects on this page?

    If so I can find the javascript for you.

    Oh and welcome to coding forums.
    Single Paradox
    My Site (Under construction)

    Not too bad for a 15 year old

  • #3
    Regular Coder
    Join Date
    Feb 2005
    Posts
    525
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Oh... try replacing the SetTimeout you have with:

    setTimeout(function() {fadeColor(which)}, 100);
    Single Paradox
    My Site (Under construction)

    Not too bad for a 15 year old

  • #4
    New Coder
    Join Date
    May 2005
    Location
    Alabama
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ummm, it didn't show the error message after i changed the "setTimeOut" part, but it still didn't do what I wanted it to do. See, I wanted it to make the background Color darker and darker every 100 MS. But it just changes the color one time and that's it. Suggestions?

    The link is supposed to first go through #C1DAFF, then after 100 miliseconds it turns into #77ADFF which is the same color in a darker version, then #3787FF which is even darker, and so on until it gets to the darkest color.

    Thanks for the help and thanks for welcoming me

  • #5
    New Coder
    Join Date
    May 2005
    Location
    Alabama
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Anybody out there that can help me with this?

  • #6
    teh Moderatorinator
    Join Date
    Sep 2004
    Location
    USA
    Posts
    2,472
    Thanks
    4
    Thanked 40 Times in 40 Posts
    PHP Code:
    <html>
    <
    head><title>Sistema de Navegación 1</title>
    <
    script language="JavaScript">
    <!--
    var 
    thenumber 0;
    function 
    fadeColor(which)
    {
        var 
    thecolors = new Array("#C1DAFF","#77ADFF","#3787FF","#004EC1","#0062F4","#0047B3");
        if(
    thenumber<5)
        {
            
    document.anchors[which].style.backgroundColor thecolors[thenumber];
            
    thenumber++;
        }
        
    setTimeout(function() {fadeColor(which)}, 100);
    }

    //-->
    </script>
    </head>
    <body>
    <a href="sistema_navegacion1.html" style="font-family:arial;text-decoration: none;color:black;" name="ellink" onmouseover="fadeColor('ellink')">Link</a>
    </body>
    </html> 

  • #7
    New Coder
    Join Date
    May 2005
    Location
    Alabama
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks brando, even though i had to change the document.anchors[] for document.anchors(), but that solved my problem, really appreciate it


  •  

    Posting Permissions

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