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 4 of 4
  1. #1
    New Coder
    Join Date
    Jun 2002
    Location
    Virginia
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation navigation/menu help ...

    I'm trying to locate code that i can use for simple "left-side-navigation"--which is not a menu dropdown ... it simply is a list of links to various pages within a certain area.

    Meaning I need to find code for navigation that when "Link/Page B" is selected, the user is taken to the respective link/page, and the chosen link on the left is no longer "hot" -- whereas the other links are availble to link/go to.

    Link/Page A
    Link/Page B
    Link/Page C
    Link/Page D

    Thanks in advance for any help!

    Des

  • #2
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Are you talking about using frames? If not, you're probably going to need a server-side language to do this.

    If you are talking about frames, this is probably doable with JS.

    The other route could be to hard-code the menu with the pages if the site isn't going to consist of too many pages..

    Sadiq.

  • #3
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try this:

    Code:
    <script type="text/javascript">
     //<![CDATA[
      function chkAnchors(){ if(!document.getElementById){ return };
       var element = document.getElementsByTagName('a');
        for(var i=0; i<element.length; i++){ 
          if(element[i] == location.href){
             element[i].removeAttribute('href');
          }
        }
      }      onload = chkAnchors;
     //]]>
    </script>
    </head>
    .....Willy

  • #4
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I recieved your P/M and I'm glad you got it working but I would rather post any changes to the script here will it will benifit the community at large...

    To change the newly made non-anchor text color....
    Add the following line highlighted in red and the hex value highlighted in blue....

    Code:
    <script type="text/javascript">
     //<![CDATA[
      function chkAnchors(){ if(!document.getElementById){ return };
       var element = document.getElementsByTagName('a');
        for(var i=0; i<element.length; i++){ 
          if(element[i] == location.href){
             element[i].removeAttribute('href');
             element[i].style.color = '#FF0000';
          }
        }
      }      onload = chkAnchors;
     //]]>
    </script>
    </head>
    .....Willy


  •  

    Posting Permissions

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