how would I dim a background of a page using jQuery?
I have the jQuery code looking like this.
$(document).ready(function(){
$("body").fadeTo(1000, 0.33);
});
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.
If you ‘dim’ the
bodyof the page you’ll be dimming every element on the page, as every element is, by definition, a child of thebodyelement. Particularly if you’re using opacity (asfadeTo()does).If you only want to dim the background-image of the
bodyelement, I’d suggest wrapping another element around the page-content and using a partially-transparent.pngas a background-image for that element, or use anrgba()background-color.background-colorproof-of-concept.background-imageproof-of-concept.