<!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> <title> new document </title> <meta name="generator" content="editplus" /> <meta name="author" content="" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <script type="text/javascript"> <!-- var $=function(id){ var obj = null; if(document.getElementById){ obj = document.getElementById(id); }else if(document.all){ obj = document.all[id]; } return obj; } function doJ(){ var div = $('face_bg'); if(div) { div.parentNode.removeChild(div); } div = document.createElement('div'); div.id = 'face_bg'; div.style.position = 'absolute'; div.style.left = div.style.top = '0px'; div.style.width = '100%'; div.style.height = document.body.scrollHeight + 'px'; div.style.backgroundColor = '#000'; div.style.zIndex = 10000; div.style.display = 'none'; div.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=0,finishOpacity=100,style=0)'; div.style.opacity = 0; div.onclick = function() { alert('wokao'); } $('append_parent').appendChild(div); div.style.display = ''; } //--> </script> </head> <body> <DIV id=append_parent></DIV> <input type="button" value="MMMMMMMMMMMMMMD" onclick="return doJ()" /> <hr /> <hr /> .WOKAO <hr /> </body> </html>
[Ctrl+A 全選 注:如需引入外部Js需重新整理才能執行]