Is there a way to 'grey out' or 'disable' an image?
For example i have this code:
<tr>
<td>
Status:
</td>
<td>
<img src="picco.jpeg">
</td>
</tr>
How can i 'grey-out' the image picco.jpeg, or have it appear to be 'disabled' like the text???
I dont think this can be done in HTML, but possibly Javascript. If i put a <div> tag around the image and then javascript code could disable the <div> tag ID onLoad would this work?
I found this code, but I am not sure how to implement it into my code:
Code:
> <div id=s1 disabled>
> <button onclick="alert('1')">click me</button>
> <button onclick="alert('2')">click me</button>
> <button onclick="alert('3')">click me</button>
> </div>
>
> When I open this code in IE6 the buttons indeed appear grayed out
> (disabled), but surprisingly - they do respond to clicks, despite
> MSDN's explicit declaration...
That won't work in any browser other than IE. It's also invalid HTML.
> Does anybody know how can I still control the buttons state or
> enable/disable their mouse events in one command?
Use your original HTML and:
if( !document.getElementById ) {
if( document.all ) {
document.getElementById = function( id ) {
return document.all[ id ];
}
} else {
document.getElementById = function() {
return null;
}
}
}
function enableGroup( prefix, num, bool ) {
bool = bool || true;
for( var i = 1, e; i <= num; ++i ) {
e = document.getElementById( prefix + num );
if( e ) e.disabled = !bool;
}
}
calling the function
enableGroup( 'b', 3 )
or
enableGroup( 'b', 3, true )
to enable b1 through b3 and
enableGroup( 'b', 3, false )
to disable b1 through b3.
Mike
it may be easier to read here:
http://www.forum4designers.com/archi...4-3-64683.html
tia guys!
:-)
Picco
www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt