$("html").fadeTo("slow",0.5); 
OR 
$("html").css({ 'opacity':'0.5' });
Why does either of these scripts whiten the page? I need it to become darker, no whiter, and usually that's what opacity doe开发者_Python百科s but not here...
How can I set a black opacity to my html with jquery?
Add a black div and fade it in on top of everything
HTML:
<body>
    <div id="cover"></div>
</body>
CSS:
#cover {
    height:100%;
    width:100%;
    background-color:#000;
    display:none;
    position:absolute;
    top:0;
    left:0;
    z-index:99999999;
}
JQuery:
$('#cover').fadeTo("slow",0.5);
Here's a working example: http://jsfiddle.net/AlienWebguy/GM2Z6/2/
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论