渐变的Alert 时间:2020-05-11 人气:0 Dolphin Document abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc <script language="javascript" type="text/javascript"> window.alert = function(txt) { /https://img.qb5200.com/download-x/document.write(txt); var shield = document.createElement("DIV"); shield.style.position = "absolute"; shield.style.left = "0px"; // shield.id = "shield"; shield.style.top = "0px"; shield.style.width = "100%"; shield.style.height = document.body.clientHeight+"px"; shield.style.background = "#333"; shield.style.textAlign = "center"; // shield.style.lineHeight = document.body.clientHeight+"px"; shield.style.zIndex = "1"; shield.style.filter = "alpha(opacity=0)"; var alertFram = document.createElement("DIV"); alertFram.style.position = "absolute"; alertFram.style.left = "50%"; alertFram.style.top = "50%"; alertFram.style.marginLeft = "-225px"; alertFram.style.marginTop = "-75px"; alertFram.style.width = "450px"; alertFram.style.height = "150px"; alertFram.style.background = "#ccc"; alertFram.style.textAlign = "center"; alertFram.style.lineHeight = "150px"; alertFram.style.zIndex = "2"; strHtml = "\n"; strHtml += " [系统提示]\n"; strHtml += " "+txt+"\n"; strHtml += " \n"; strHtml += "\n"; alertFram.innerHTML = strHtml; document.body.appendChild(alertFram); document.body.appendChild(shield); var c = 0; this.doAlpha = function(){ if (c++ > 10){clearInterval(ad);return 0;} shield.style.filter = "alpha(opacity="+c+");"; } var ad = setInterval("doAlpha()",20); this.doOk = function(){ alertFram.style.display = "none"; shield.style.display = "none"; } } </script> [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行] 加载全部内容