渐变的Alert_Javascript教程-查字典教程网
渐变的Alert
渐变的Alert
发布时间:2016-12-30 来源:查字典编辑
摘要:DolphinDocumentabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabca...

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

window.alert = function(txt) { //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"; } }

[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新Javascript教程学习
    热门Javascript教程学习
    编程开发子分类