sorry to bump an old thread, but i have been working on this for a while now, and just ran accross this thread in searching deeper for help.
I am trying to implement a way to highlight the current page in the top level of my menu. I am NOT worried about any submenu's, as my site is only about 4 pages, and all submenu's actually refer to tabs on one of the 4 pages. I tried to implement a custom fix, but I am not having any luck. Here is what I have so far, if anyone can point me in the direction or give me hints of what I might be missing with this.
here is what I have on my .html page
basically, I am just getting the name of the page (i.e. index.html) and checking to see if it matches the href attribute in my menu
If something is wrong here, please let me know..I pulled this from HERE
Code:
<script type="text/javascript">
$(document).ready(function(){
var path = location.pathname.substring(location.pathname.lastIndexOf("/") + 1);
<!--path = path.lastIndexOf("/");-->
if ( path )
$('#smoothmenu1 a[href$="' + path + '"]').attr('ddsmoothmenu', 'current');
<!--alert(path);-->
});
</script>
I have tried every combination I could think of for the "current" in my ddsmoothmenu.css file, as you can see below. am i missing something here?
Code:
.ddsmoothmenu ul li.current{
background-color: #fff;
color: #000;
}
.ddsmoothmenu ul li a.current{
background-color: #fff;
color: #000;
}
.ddsmoothmenu .current{
background-color: #fff;
color: #000;
}
.current{
background-color: #fff;
color: #000;
}
the basic thing I am trying to do here, is if I am on that page, set that top level menu item's background color to white, and the text color to black, but leave all previous(inherited) information the same.
thoughts? am i going about this all wrong?
thank you
Bookmarks