View Single Post
Old 04-18-2011, 02:55 AM   PM User | #2
bullant
Banned

 
Join Date: Feb 2011
Posts: 2,699
Thanks: 13
Thanked 395 Times in 395 Posts
bullant is on a distinguished road
You don't need javascript to change the menu text colour on mouseover. You can do it with just css and is better imo because it will still work in javascript disabled browsers.

Something like this which changes the link text from green to red on hover.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
        <title></title>
        <style type="text/css">
            #topnav a {
                color: green;
            }
            #topnav a:hover {
                color: red;
            }
        </style>
        <script type="text/javascript"></script>
    </head>
    <body>
        <ol id="topnav">
            <li><a href="#">portfolio</a></li>
            <li><a href="#">about</a></li>
            <li><a href="#">contact</a></li>
        </ol>
    </body>
</html>
bullant is offline   Reply With Quote