views:

112

answers:

3

On this site: http://www.winteradagency.com/mrw/real_estate.php the navigation uses a javascript that highlights the selections as you mouseover them. Is there an easy way to change the code so that the page the user is on stays highlighted? That helps them see what page they're on and allows for better navigation.

thanks

A: 

use the css pseudo classes :hover and :active. active determines the style if the styled link is the currently active one. There really isn't any need to do this with javascript.

See http://www.w3schools.com/CSS/css_pseudo_classes.asp

Quote:

a:link {color:#FF0000;} /* unvisited link /
a:visited {color:#00FF00;} /
visited link /
a:hover {color:#FF00FF;} /
mouse over link /
a:active {color:#0000FF;} /
selected link */

a.red:visited {color:#FF0000;}
<a class="red" href="css_syntax.asp">CSS Syntax</a>

Jonathan Fingland
A: 

Yes, you will need a 'hook' to do it though. You can either examine the URL with JavaScript, or use a server side language to put a hook somewhere, like class="active"

alex
a hook? I need more help on that one...
Drea
Well a hook is just a name... an example is adding a class to an element.
alex
A: 

For a quick javascript fix you could loop through the menu items and highlight the one who's url matches the current page.

CrazyJugglerDrummer
yea, if this were a small page that would work but it's big and the pages are being generated from a database... notice the php
Drea