Results 1 to 2 of 2

Thread: OnClick Change Font color

  1. #1
    Join Date
    Feb 2006
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default OnClick Change Font color

    Heyyy

    I have the following menu ^^

    Code:
    ...
    <td width="10%" height="25"><a href="#" onClick="showit(0)" style="text-decoration:none;"><span class="Menu1Title">Home</span></a></td>
    <td width="10%" height="25"><a href="#" onClick="showit(1)" style="text-decoration:none;"><span class="Menu1Title">I Servizi</span></a></td>
    ...
    And i use the following style

    Code:
    .Menu1Title {
            background-color:#FFFFFF;
    	font-family: Verdana, Arial, Helvetica, sans-serif; 
    	font-size: 12px; 
    	font-weight: bold; 
    	color: #253D56; 	
    	letter-spacing: 2px; 
    	text-decoration:none;
    }
    What i want to do is change the font colour of the menu ONLY when the user clicks on the link (for example Home). And when the user clicks another link (for example Servizi) "Home" should get the normal font colour and "Sercizi" should get the new font colour..

    Anyone ???

    Thanks

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Use Javascript to change the class of the link when clicked.
    I can't be more specific without seeing the full code for the menu.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franais | entiendo espaol | ti t hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •