짐
代码如下 :
<html> <head> <script type = "text/javaScript"> var alertobj = new Object (); var generalstyle = {zindex : 0, 너비 : "200px", 높이 : "100px", 테두리 : "두꺼운 단단한 #cccccc", 배경 : "#ffffff", 위치 : "절대", "35%", 왼쪽 : "40%"} var btnstyle = {popartue ","40 " "70%", 색상 : "#3333333", fontweight : "bold", oldlinecolor : "#3366ff", "#3366ff", oldlinestyle : "ridge", ontlinewidth : "얇은", // 개요 : "Thin ridge#3366ff", Innerhtml : "Ok"realertobj = {Generalset : Generals,, txtet : txteste, txtetset : txtetset : txtesty. btnset : btnstyle, isexist : false} alertobj.createcomponent = function () {var component = document.createElement (arguments [0]); var 스타일 = 인수 [1]; for (스타일의 var 속성) {if (styles [property]! = null) {try {component.style [property] = Styles [property]; } catch (err) {document.write (err.name+":"+property+"<br/>"); // 속성 오류 설정! }}} 반환 구성 요소; } alertobj.show = function () {if (! this.isexist) {this.isexist = true; var bodybj = document.body; bodybj.style.zindex = -1; bodybj.style.background = "#999999"; var divobj = this.createComponent ( "div", this.generalset); var txtobj = this.createComponent ( "p", this.txtset); txtobj.innerhtml = 인수 [0]; var btnobj = this.createComponent ( "button", this.btnset); btnobj.innerhtml = this.btnset.innerhtml; btnobj.onclick = function () {bodyobj.style.zindex = 0; bodybj.style.background = ""; Bodybj.removeChild (divobj); if (alertobj.isexist) {alertobj.isexist = false; }} divobj.appendChild (txtobj); Divobj.appendChild (btnobj); Bodybj.appendChild (divobj); }} 함수 show (s) {alertobj.show (s); } </script> </head> <body> <p onclick = "show ( '내부 테스트');"> 알림 표시 </p> </body> </html> 클릭하십시오.