Developer forum

Forum » Templates » How to make the active button stay active!

How to make the active button stay active!


Reply

Hi you guys


 


I need your help: i have this site (http://contex.net.dynamicweb.dk). When you click a tab on the topmenu and go to the page, i need for the tab to stay red. How do i do that? The menu is a XSLT-menu. I have the same problem with the left menues on the sub-pages.


 


Does anyone know how to fix it??


 


/Iben Louise


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Iben


 


In your XSLT add something like this right after the


  •  



    MenuActive



     


    In your stylesheet you have this:


    #menu li a:active {


    background-image: url('topMenuBg_active.gif');


    background-repeat: repeat-x;


    height: 24px;


    float: left;


    }


     


    Make it something like this (not sure its totally correct, but you get the idea):


    #menu li a:active, li.MenuActive {


    background-image: url('topMenuBg_active.gif');


    background-repeat: repeat-x;


    height: 24px;


    float: left;


    }


     


    Let me know if you need more help.

  •  
    Reply

    Thanks a lot. I'll try it and let you know if it works :D


     


    /Iben Louise

     
    Reply

    It won't work for me. And im too XML-stupid to see where it goes wrong (i still need to read The Big Book On XML and XSLT)


     


    /Iben Louise


     
    Nicolai Høeg Pedersen
    Reply

    Hi Iben Louise


     


    I made a little change to your topmenu.xslt and your css so it now works for the top navigation. It has a class called TopMenuActive and .TopMenuActive a in the css.


     


    Then i had the leftnavigation put the class MenuActive on the first level of li in the navigation if it is in path. But I could not find a suitable css block for the hover/active of 2. level navigation items. Don't think its there yet.


     


    Anyway - same concept as in the topmenu.

     
    Reply

    Hi Nicolai


     


    Thanks a lot. You are a star :D


     


    I owe you one.


     


    /Iben Louise

     

    You must be logged in to post in the forum