Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Change Color on click

    Hi Guys,

    I am trying to change the color of the Tab once i have clicked the hyperlink and the underline row color as well but after trying for long i cant figure out as how to do it pleas help. I am posting the HTML and the CSS

    <table border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td>
    <div>
    <table cellpadding="0" cellspacing="0" border="0">
    <tr>
    <td nowrap="nowrap">
    <div>

    <a id ="stup" class="Tab" href="../SearchScreens/JobSearch.aspx" title="Jobs Tab">Jobs</a></div>

    </td>
    <td nowrap="nowrap">
    <div>
    <a class="Tab" href="../SearchScreens/CorpSearch.aspx" title="Accounts Tab">Accounts</a></div>
    </td>
    <td nowrap="nowrap">
    <div>
    <a class="Tab" href="../SearchScreens/CorpSearch.aspx" title="Quality Tab">Quality</a></div>
    </td>


    <td nowrap="nowrap">
    <div>
    <a class="Tab" href="../SearchScreens/CorpSearch.aspx" title="Operations Tab">Operations</a></div>
    </td>
    </tr>
    </table>
    </div>
    </td>
    </tr>
    <tr>
    <td class="sp">
    </td>
    </tr>
    </table>

    The CSS running against it is, which u can see is been put against every hyperlink

    .Tab
    {
    background-image: url(../images/tab_white2.jpg);
    padding-left: 5px;
    background-repeat: no-repeat;
    display: inline-block;
    text-decoration: none;
    color: #373937;
    font-size: 8pt;
    height: 20px;
    width: 100px;
    padding-top: 3px;
    vertical-align: middle;
    margin-right: 0px;
    text-align:center;

    }

    I hope, i have well explained what i am trying to achieve please help.
    Once again i need to change the Tab color which is nothing more than the image color which is been referenced in the CSS, once i have clicked the hyperlink.

    So please help as how can i change the image once i have clicked on the hyperlink or if its possible to do it via javascript.

    Thanks in advance..

    A..

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,466
    Thanks
    3
    Thanked 495 Times in 482 Posts
    when you click the link, the link page will be loaded, so I guess you need a cookie to remember what has been clicked when the visiter returns to the page
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/


  •  

    Posting Permissions

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