简体   繁体   中英

fading everything but div out like blockUI

I have a fiddle here that has a big blue div. When i click the button, i'd like to select everything but the div and fade it out.

I've tried things like $("body :not('#myBody')").css({opacity : '0.1'}); and things like this but nothing has worked yet.

I've also looked through the blockUI code, but couldn't quite comprehend it.

How do you all fade background elements out? enter link description here

You had the wrong id and quotes around your opacity. This fiddle works with this code:

 $("body :not('#box')").css({opacity: 0.1});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM