Tabular Menu Issue

Discussion in 'HTML / PHP / JavaScript / CSS' started by pauldaly1982, Jan 12, 2006.

  1. Hello,

    I'm having an issue with my tabular menu at www.paul-daly.com. When you hover over a tab, it turns white. However, when you select and move the cursor off of a tab, the color returns to gray. I would like the selected tab to remain white until another tab is chosen.

    I've seen examples on the net that suggest defining the id of the current tab for each page. The problem with this is that I'm using ASP.NET 2.0's master pages. The tabular menu is in the master page file and I do not want to duplicate work across each page.

    Thanks in advance for your help,

    Paul Daly
     
  2. I'm sure you could write some pretty simple code in your master page file (or codebehind) to check the current URL, then turn the appropriate link to white.

    I've also written a custom control in the past that has saved me a ton of time. I called it a 'one way link'. The link acts as normal except if it points to the current page, in which case it turns into a <span> instead of a link and takes on a user defined CSS class. So my one way link would look like:

    <uc:OneWayLink NavigateUrl='/Contact.aspx' SelectedClass='WhiteBackground'>Contact Me</uc:OneWayLink>

    My code isn't the most elegant in the world, so I won't share it here, but it basically just compares NavigateUrl to the current URL and if it's a match, replaces the link like I mentioned.
     

Share This Page