[ SOLVED ] Active State Navigation - Printable Version +- GetSimple Support Forum (http://get-simple.info/forums) +-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3) +--- Forum: Scripts & Components (http://get-simple.info/forums/forumdisplay.php?fid=11) +--- Thread: [ SOLVED ] Active State Navigation (/showthread.php?tid=1558) |
[ SOLVED ] Active State Navigation - andreasbj - 2011-04-11 Hi. I am wondering if anyone can help me with the making of navigation/menu with site active state. By that I mean when a user clicks a link on the menu, the menu item will stay active for the page he's viewing. I'm not good in CSS/PHP, but I'm trying, by taking hints from other templates and learning by that. This is part of my style.css file: Code: .menu_nav { And this is part of template.php - only the menu: Code: <div class="menu_nav"> As you see I haven't coded anything in template.php to activate the class, or whatever I should do - I'm stuck. I hope someone could help me. Thank you. [ SOLVED ] Active State Navigation - n00dles101 - 2011-04-11 hi andreasbj, Welcome to the forum. The built in function to display menu "get_navigation(return_page_slug());" will automatically add a class "current" to the current page menu item. Just change your CSS code to Code: .menu_nav ul li.current a, .menu_nav ul li a:hover { Mike [ SOLVED ] Active State Navigation - andreasbj - 2011-04-11 The CSS you ask me to change to, isn't that the CSS I already have? Maby I just didnt understand? [ SOLVED ] Active State Navigation - n00dles101 - 2011-04-12 your right !! 8) I've changed it now. [ SOLVED ] Active State Navigation - andreasbj - 2011-04-12 Hehe, thank you. Works perfectly! |