rurth24
asked on
Get Folder
Hey all, I'm trying check a file path and active a function.
I'm working with a Navigation bar and a Sub-navigation bar. At start the Sub Nav is turned off via css (display=none)
Want I want to do is turn the subnav on depending on what channel (folder they are currently in).
Anybody have a idea on how I would check file paths and run the logic behind it? Any help would be great.
Thanks
I'm working with a Navigation bar and a Sub-navigation bar. At start the Sub Nav is turned off via css (display=none)
Want I want to do is turn the subnav on depending on what channel (folder they are currently in).
Anybody have a idea on how I would check file paths and run the logic behind it? Any help would be great.
Thanks
Umm, try this.
Note: your id for each sub nav will need to be "sub_nav_%FOLDERNAME%", where %FOLDERNAME% is the name of the folder where this sub nav would be visible.
Note: your id for each sub nav will need to be "sub_nav_%FOLDERNAME%", where %FOLDERNAME% is the name of the folder where this sub nav would be visible.
<script type="text/javascript">
function show SubNav(){
var getFolder=new Array();
getFolder=unescape(top.location.href).split('/');
var folder=getFolder[getFolder.length-2];
document.getElementById('sub_nav_%FOLDERNAME%').style.display='block';
}
window.onload=SubNav();
</script>
Sorry, that code should have been this:
<script type="text/javascript">
function show SubNav(){
var getFolder=new Array();
getFolder=unescape(top.location.href).split('/');
var folder=getFolder[getFolder.length-2];
document.getElementById('sub_nav_'+folder).style.display='block';
}
window.onload=SubNav();
</script>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Ziff/mplung...
I'm going to test this out shortly and let you know the outcome...
Thanks again.
I'm going to test this out shortly and let you know the outcome...
Thanks again.
if (location.href.indexOf('ho