Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,

I want to change the colour of the image after click , Basically all the images in the nav bar are background images set in css and I have another class with greater opacity (same as google plus nav bar )

My CSS are:

#vtab > ul > li.home {
background: url('images/home21.png') no-repeat center center;

}

#vtab > ul > li.selected {
opacity: 1;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);

border-right: none;
z-index: -1;

position: relative;
}
#vtab > ul > li:hover , #vtab > ul > li:active,#vtab > ul > li:focus,#vtab > ul > li:visited {
opacity: 1;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);

border-right: none;
z-index: -1;

position: relative;
}



HTML:

  • Home

  • Courses







  • <img src="images/leftarrow1.png" style="height: 88px;width: 74px;margin-left: -47px;margin-top: -18px; position:relative"
    />


    This is the nav bar set in list .

    For more detail I have uploaded this at link : www.adhyay.aargss.com
    Please have a look at left navigation bar , As of now only hover effect is given but i want that hover effect to be permanent after click which would be same as google plus.

    Please help .
    Posted
    Comments
    Brian A Stephens 29-Apr-13 16:04pm    
    Please post any JS related to the above code and reveal the html SOURCE, rather than rendered. It looks like you have a clickimagechange() function that we need to see. From piecing apart the HTML in the page source of your post, it looks like your LI and UL tags are all scrambled. I would rather see just the relevant code here than go out to the full external site. Thanks.
    AlphaDeltaTheta 1-May-13 3:51am    
    Your site has rendering issues with IE10

    1 solution

    As per my inspection, Google plus uses two sets of images - one gray scale and anoe coloured all embedded in one single image. they then use css image sprites i.e., display a part of the image. And their css for hover and selected is same.

    And a small advice:
    I found that you use filters, filters deprecated in IE and are windows specific. It is better to use two sets of images embedded in a single image for faster loading.
     
    Share this answer
     

    This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



    CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900