Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grey Filters

Status
Not open for further replies.

Onsi

IS-IT--Management
Jul 21, 2003
5
EG
Any Idea how to make an image goes grey when clicked using CSS
 
Code:
<div id=&quot;myimg&quot; 
     style=&quot;position:absolute; 
            top:50px;
            left:10px;  

     filter:progid:DXImageTransform.Microsoft.BasicImage(
      grayscale=0, 
      xray=0, 
      mirror=0, 
      invert=0, 
      opacity=1, 
      rotation=0)&quot;
>
<img src=&quot;animage.jpg&quot; 
     onclick=&quot;document.getElementById('myimg').filters.item(0).grayscale='1';&quot;/>
</div>
 
This will only work in IE though wont it?

MrBelfry
 
Thank You Very Much For Your Replay,
But I found an easier way ...here it is

<head>
<style>
<!--
A:visited img {FILTER: &quot;Gray&quot; }
-->
</style>
</head>

<body>
<a href=&quot;#&quot;><img src=&quot;anyimage.xyz&quot; ></a>
</body>

same results ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top