Make the background so dim (a method to adjust the background color of the page when a prompt is displayed). some people asked about this effect in the forum a few days ago. I am free to study it today. I made the original mark, because I did not refer to other people's code when writing this method. My method is to add the ALPHA filter to the layer mask to achieve the expected effect.
<Head> <meta http-equiv = "Content-Type" content = "text/html; charset = gb2312 "/> <title> Prompt Box </title> <style type =" text/css "> a {color: #000; font-size: 12px; text-decoration: none} a: hover {color: #900; text-decoration: underline} body {background:; filter: progid: DXImageTransform. microsoft. gradient (gradientType = 0, startColorStr = # ffffff, endColorStr = #003366); overflow: hidden} # massage_box {position: absolute; le Ft: expression (body. clientWidth-350)/2); top: expression (body. clientHeight-200)/2); width: 350px; height: 200px; filter: dropshadow (color = #666666, offx = 3, offy = 3, positive = 2); z-index: 2; visibility: hidden} # mask {position: absolute; top: 0; left: 0; width: expression (body. clientWidth); height: expression (body. clientHeight); background: #666; filter: ALPHA (opacity = 60); z-index: 1; visibility: hidden }. massage {bord Er: #036 solid; border-width: 1 1 3 1; width: 95%; height: 95%; background: # fff; color: #036; font-size: 12px; line-height: 150% }. header {background: #036; height: 10%; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; padding: 3 5 0 5; color: # fff }</style> </pead> <body> <p id = "massage_box"> <p class = "massage"> <p class = "header"> <p style = "display: inline; width: 150px; position: absolute "> This site prompts you Information </p> × </p> <ul style = "margin-right: 25"> <li> I declare that all articles (including illustrations) on this blog are original, if you need to quote or repost, please indicate the source. </Li> <li> You are welcome to leave comments on your opinions in this blog post. do not drop the complaints of bored people who have no quality or opinion. </Li> <li> background music has been set up on this site. when listening to music collected in the music box, close the background music at the bottom of the page. </Li> </ul> </p> <p id = "mask"> </p> Display prompt information </body> </ptml>
[Ctrl + A Select All Note: If you need to introduce external Js, you need to refresh it to execute]
Drag message box
<Head> <meta http-equiv = "Content-Type" content = "text/html; charset = gb2312 "/> <title> Prompt Box </title> <style type =" text/css "> a {color: #000; font-size: 12px; text-decoration: none} a: hover {color: #900; text-decoration: underline} body {background:; filter: progid: DXImageTransform. microsoft. gradient (gradientType = 0, startColorStr = # ffffff, endColorStr = #003366); overflow: hidden} # massage_box {position: absolute; le Ft: expression (body. clientWidth-350)/2); top: expression (body. clientHeight-200)/2); width: 350px; height: 200px; filter: dropshadow (color = #666666, offx = 3, offy = 3, positive = 2); z-index: 2; visibility: hidden} # mask {position: absolute; top: 0; left: 0; width: expression (body. clientWidth); height: expression (body. clientHeight); background: #666; filter: ALPHA (opacity = 60); z-index: 1; visibility: hidden }. massage {bord Er: #036 solid; border-width: 1 1 3 1; width: 95%; height: 95%; background: # fff; color: #036; font-size: 12px; line-height: 150% }. header {background: #036; height: 10%; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; padding: 3 5 0 5; color: # fff} </style> <! -- Implement layer movement --> <script language = "javascript"> var Obj = ''document. onmouseup = MUp document. onmousemove = MMove function MDown (Object) {Obj = Object. id document. all (Obj ). setCapture () pX = event. x-document.all (Obj ). style. pixelLeft; pY = event. y-document.all (Obj ). style. pixelTop;} function MMove () {if (Obj! = '') {Document. all (Obj ). style. left = event. x-pX; document. all (Obj ). style. top = event. y-pY ;}} function MUp () {if (Obj! = '') {Document. all (Obj ). releaseCapture (); Obj = '';}} script </pead> <body> <p id = "massage_box"> <p class = "massage"> <p class = "header" onmousedown = MDown (massage_box)> <p style = "display: inline; width: 150px; position: absolute"> site prompt information </p> × </p> <ul style = "margin-right: 25 "> <li> I declare that all the articles (including illustrations) on this blog are original articles. if you need to quote or repost them, please indicate the source. </Li> <li> You are welcome to leave comments on your opinions in this blog post. do not drop the complaints of bored people who have no quality or opinion. </Li> <li> background music has been set up on this site. when listening to music collected in the music box, close the background music at the bottom of the page. </Li> </ul> </p> <p id = "mask"> </p> Display prompt information </body> </ptml>
[Ctrl + A Select All Note: If you need to introduce external Js, you need to refresh it to execute]
So why cannot I adapt to the height? Can I retrieve the page height? Why not?
Use scrollWidth and scrollHeight.
<Head> <meta http-equiv = "Content-Type" content = "text/html; charset = gb2312 "/> <title> Prompt Box </title> <style type =" text/css "> a {color: #000; font-size: 12px; text-decoration: none} a: hover {color: #900; text-decoration: underline} body {background:; filter: progid: DXImageTransform. microsoft. gradient (gradientType = 0, startColorStr = # ffffff, endColorStr = #003366); overflow: hidden} # massage_box {position: absolute; le Ft: expression (body. clientWidth-350)/2); top: expression (body. clientHeight-200)/2); width: 350px; height: 200px; filter: dropshadow (color = #666666, offx = 3, offy = 3, positive = 2); z-index: 2; visibility: hidden} # mask {position: absolute; top: 0; left: 0; width: expression (body. scrollWidth); height: expression (body. scrollHeight); background: #666; filter: ALPHA (opacity = 60); z-index: 1; visibility: hidden }. massage {bord Er: #036 solid; border-width: 1 1 3 1; width: 95%; height: 95%; background: # fff; color: #036; font-size: 12px; line-height: 150% }. header {background: #036; height: 10%; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; padding: 3 5 0 5; color: # fff} </style> <! -- Implement layer movement --> <script language = "javascript"> var Obj = ''document. onmouseup = MUp document. onmousemove = MMove function MDown (Object) {Obj = Object. id document. all (Obj ). setCapture () pX = event. x-document.all (Obj ). style. pixelLeft; pY = event. y-document.all (Obj ). style. pixelTop;} function MMove () {if (Obj! = '') {Document. all (Obj ). style. left = event. x-pX; document. all (Obj ). style. top = event. y-pY ;}} function MUp () {if (Obj! = '') {Document. all (Obj ). releaseCapture (); Obj = '';}} script </pead> <body> <p id = "massage_box"> <p class = "massage"> <p class = "header" onmousedown = MDown (massage_box)> <p style = "display: inline; width: 150px; position: absolute"> site prompt information </p> × </p> <ul style = "margin-right: 25 "> <li> I declare that all the articles (including illustrations) on this blog are original articles. if you need to quote or repost them, please indicate the source. </Li> <li> You are welcome to leave comments on your opinions in this blog post. do not drop the complaints of bored people who have no quality or opinion. </Li> <li> background music has been set up on this site. when listening to music collected in the music box, close the background music at the bottom of the page. </Li> </ul> </p> <p id = "mask"> </p> Display the prompt message bottom here </body> </ptml>
[Ctrl + A Select All Note: If you need to introduce external Js, you need to refresh it to execute]