What is the best way to set the transparency of a HTML DIV element and its contents using jQuery?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
$('#my_element').css({ 'opacity' : 0.7 });Do you want to actually set the opacity to each of the contained elements as well, or you just want it to ‘appear’ as if the child elements have the same opacity?
As an example to my question, if you wanted something that sets an element, and each of the children elements, you could do something like this
html
jquery
Hope this helps. Cheers.