Results 1 to 2 of 2

Thread: Revisited Need your help again

  1. #1
    Join Date
    Jul 2006
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Revisited Need your help again

    First I would like to Thank the Dynamic Forums and its dedicated members.

    Here's the problem:

    I have a js script that will highlight (style) the current page on the navigation links.

    The nav is styled so that the:
    a:visited, a:link are the same colors.
    a:hover is color x
    a:active is color y

    The js script will style the current nav hyper link but the color is over ridden by the a:visited. The objective is to keep all the hyper links the SAME color except for the a:hover and current link.

    Here's the link:

    Click on links under Mechanical Setups and note that the nav color will be gray & larger. The current nav should have a different color but does not.

    http://www.ibanezfromguam.net/myrapt..._homepage.html


    JS script
    Code:
    // JavaScript Document
    
    function hlightpagelink(){
    
    var url=location.href
    
    if(url.indexOf('r50v2/r50v2_aileron_linkage.htm')>-1)
    document.getElementById('r50v2_aileron_linkage_link').className='onthispage'
    
    if(url.indexOf('r50v2/r50v2_elevator_linkage.htm')>-1)
    document.getElementById('r50v2_elevator_linkage_link').className='onthispage'
    
    if(url.indexOf('r50v2/r50v2_collective_linkage.htm')>-1)
    document.getElementById('r50v2_collective_linkage_link').className='onthispage'
    
    if(url.indexOf('r50v2/r50v2_throttle_linkage.htm')>-1)
    document.getElementById('r50v2_throttle_linkage_link').className='onthispage'
    
    if(url.indexOf('r50v2/r50v2_rudder_linkage.htm')>-1)
    document.getElementById('r50v2_rudder_linkage_link').className='onthispage'
    }
    
    if ( typeof window.addEventListener != "undefined" )
        window.addEventListener( "load", hlightpagelink, false );
    else if ( typeof window.attachEvent != "undefined" )
        window.attachEvent( "onload", hlightpagelink );
    else {
        if ( window.onload != null ) {
            var oldOnload = window.onload;
            window.onload = function ( e ) {
                oldOnload( e );
                hlightpagelink();
            };
        }
        else
            window.onload = hlightpagelink;
    }
    CSS

    Code:
    .leftnav a:visited {
     text-decoration: none;  
     color: #797979;
     }
    
    .leftnav a:link {
     text-decoration: none;
     color: #797979;
    }
    
    .leftnav a:hover   {
     color: #c02020;
     text-decoration: underline;
    }
    	
    .leftnav a:active { 
     font-weight: bold;
     color: #797979;
     text-decoration: underline;
    }	
    
    .onthispage {
     font-weight: bold;
     text-decoration: underline;
     font-size: 1.2em;
     color: #008000;
     }
    HTML

    [HTML]


    [/ <h6 class="color_b">Mechanical Setups </h6>

    <ul class="leftnav align_c">
    <li><a href="../r50v2/r50v2_aileron_linkage.html" id="r50v2_aileron_linkage_link">Aileron Linkage </a></li>
    <li><a href="../r50v2/r50v2_elevator_linkage.html" id="r50v2_elevator_linkage_link">Elevator Linkage </a></li>
    <li><a href="../r50v2/r50v2_collective_linkage.html" id="r50v2_collective_linkage_link">Collective Linkage </a></li>
    <li><a href="../r50v2/r50v2_throttle_linkage.html" id="r50v2_throttle_linkage_link">Rudder Linkage </a></li>
    <li><a href="../r50v2/r50v2_rudder_linkage.html" id="r50v2_rudder_linkage_link">Rudder Linkage </a></li>
    </ul>HTML]

  2. #2
    Join Date
    Jul 2006
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Fixed it ...had to declare a color in the <a> </a> for the fonts to stay gray.

    Thanks to all for looking

Bookmarks

Posting Permissions

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