0

I'm planning on doing this, but I can't get my head around to if this is completely possible or not.

I'm trying to follow this design:
http://i37.tinypic.com/28hfpzm.jpg

The list on the left is populated by SQL. When clicking on one of these links on the left, the page will change (i.e. something like designers.php?designerID=whatever).

All this I can do easily, but I'm looking more at the CSS coding. You see when I click on a link, it covers in a purple box to show you've selected it (You can see in the image that Helen Mary is selected). I can do this in an non SQL list, but how would I do this WITH an SQL populated list?

1
  • What does SQL have to do with things? The source of the data is irrelevant. Commented Aug 9, 2010 at 12:17

1 Answer 1

2

When you display your list you know your parameters and the current parameter too. All you need is to mark the current li with a custom class like current then set it's background color in CSS.

<?php

foreach($nav as $key => $label)
{
    $class = $key == $_GET['designerID'] ? 'current' : 'normal';
    print '<li class="' . $class . '">' . $label . </li>';
}
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.