...

View Full Version : How can I show the position on navigation menu where you are right now?



clonedalian
12-30-2003, 04:20 PM
When you go to other pages on a website, its navigation menu shows where you're right now.

I don't know how to make it, so please help me out!

Thanks.

justame
12-30-2003, 05:51 PM
clo...
do youuu mean something just a like® this???



<script LANGUAGE="JavaScript">
<!-- Begin
//author: Jake Fairhead
var path = "";
var href = window.location.href;
var start = href.substring(0, href.indexOf('//') + 2);
var pos = href.indexOf('//');
href = href.substring(pos + 2, href.length);
pos = href.indexOf('/');
path = start + "";

document.write(start);
while (pos != -1) {
var name = href.substring(0, pos);
path += name + "/";
document.write("<a href=\"" + path + "\">" + name + "</a>");
document.write(">");
href = href.substring(pos + 1, href.length);
pos = href.indexOf('/');
}

// remove anchors
if (href.indexOf('#') != -1) {
href = href.substring(0, href.indexOf('#'));
}

// remove query string
if (href.indexOf('?') != -1) {
href = href.substring(0, href.indexOf('?'));
}
document.write("<a href=\"" + path + href + "\">" + href + "</a>");

// End -->
</script>


just a goodluck® n' welcome to the forum...:O)))

clonedalian
12-30-2003, 06:32 PM
Thanks.

I'm going to try your code as soon as I come home.

ClonedAlian



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum