I'm running into problems trying to highlight a menu item in my CSS navigation bar to keep track of where the user currently is.
I'm trying to pass a url into a function, get it's directory and then compare it with the directory of the page that the user is on, and then return a boolean value based on if it matches or not. Then while I run through a loop to generate my menu i want it to give the item that returns true class="current"
Not sure if that makes sense, i'll attach the code. If anyone can help me out that would be great
Lines 251-261 generate the top menu where i want the active directory to be highlighted.
The DisplayButton function at line 329 is where it generate the list element for each menu item which is where it will either create it with id="current" or with no id. And the IsURLCurrentDirectory function right above that at line 312 is where i'm trying to compare the current directory with the passed url.
Sorry if my code is messy...
Edited by Daemonicus, 03 May 2011 - 11:51 AM.