views:

43

answers:

1

I'd like to show that a div is disabled not only by disabling the form controls but also by dimming out the div itself.

How can I do this?

+3  A: 

You can reduce the opacity of the element with fadeTo, for example

$('#a_div').fadeTo('slow',.3);

The first argument is the speed. You can supply it in milliseconds, or the strings 'slow' or 'fast', which are 600ms and 200ms respectively. Any other string is interpreted as 400ms.

The second argument is the final opacity. 0 is fully transparent (invisible), 1 is fully opaque.

Alex JL