...

View Full Version : navigation/menu help ...



des55
07-12-2004, 05:45 PM
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

sad69
07-12-2004, 07:59 PM
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.

Willy Duitt
07-12-2004, 09:24 PM
Try this:



<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

Willy Duitt
07-13-2004, 08:18 PM
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....



<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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum