> -----Original Message-----
> From: Gilad Fitoussi
> Subject: [css-d] Make a disabled image gray.
> 
> 1. Using expression:
> <style>img { filter:expression( eval("this.disabled? 
> 'gray':''") ); }</style>
> <img id="gray1" disabled src='../icons/folder.gif'>
> <img id="b" src='../icons/folder.gif'>
>  
> 2. Using behavior:
> if (element.disabled && element.style.filter=="") {
>             element.style.filter = "gray()";  
> }
>  
> How can it be done?

Firstly, there is no disabled attribute for the img element, which might 
explain why that isn't working. <img src="folder.gif" disabled > is not valid 
HTML code, so I'd suggest something like <img class="disabled"> instead.

Secondly, filter:expression is a Microsoft extension to CSS, so it will only 
work in Internet Explorer. If you want to grey it out, I'd recommend that you 
set it's opacity to 50% using a bit of javascript. http://lyxus.net/mv would be 
a good place to start, because it discusses an opacity script that works with 
Firefox, Safari, KHTML, Internet Explorer and CSS3 capable browsers. You might 
also want to give it a grey border, or simply hide it altogether for browsers 
who do not support Opacity.

I hope that helps,
Cheers,


-- 
Olly Hodgson
Web Designer, Sesame

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to