<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>jquery遮罩效果-Yovae.com</title> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <style type="text/css"> #overlay { display:none; 100%; height:100%; position:absolute; left:0; top:0; background:#e5e5e5; overflow:hidden; z-index:500px; opacity .75; -moz-opacity;.75 filter:alpha(opacity=75) } </style> </head> <body> <div id="overlay"> </div> <button id="bt"></button> <script type="text/javascript"> $(function(){ $("#bt").click(function(){ $("#overlay").fadeIn(1000); }); }); </script> </body> </html>