Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable div in jquery with shadowing

Tags:

html

jquery

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?

like image 463
Caveatrob Avatar asked Feb 27 '23 01:02

Caveatrob


1 Answers

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.

like image 56
JAL Avatar answered Mar 07 '23 12:03

JAL