找回密码
 入学

QQ登录

只需一步,快速开始

查看: 1030|回复: 0

弹出提示的效果

[复制链接]
发表于 2008-11-18 14:40:22 | 显示全部楼层 |阅读模式
  1. <html xmlns="http://www.w3.org/1999/xhtml">
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  4. <title>cao888---提示</title>
  5. </head>
  6. <body>
  7. <script language=javascript>
  8. var cao_x,cao_y;
  9. function cao888()
  10. {
  11. this.display=display;
  12. }
  13. function display()
  14. {
  15.   document.write("<table align=center><tr><td><button style='width:100px;height:30px;font-size:12px;border:1px solid #A4B3C8;background-color:green;' type=button onclick=document.getElementById('cao1').style.display='block' onfocus=this.blur()>CAO留言</button></td></tr></table>");
  16.   document.write("<div  id='cao1' style='font-size:12px;position:absolute;display:none;text-align:center;overflow:visible'>");
  17.   document.write("<div style='position:absolute;top:expression((body.clientHeight-300)/2);left:expression((body.clientWidth-200)/2);width:200px;height:180px;background-color:#dbdbdb;border:1px solid #cccccc;'>");
  18.   document.write("<table width=200 height=20 bgcolor=green onmousedown='cao_x=event.x-parentNode.style.pixelLeft;cao_y=event.y-parentNode.style.pixelTop;setCapture();' onmouseup='releaseCapture();' onmousemove='caoMove(this.parentNode)' style='cursor:move;'>");
  19.   document.write("<tr align=center>");
  20.   document.write("<td align=left>提示:CAO888</td>");
  21.   document.write("</tr>");
  22.   document.write("</table>");
  23.   document.write("<span style= cursor:hand onclick=this.parentNode.parentNode.style.display='none';><img src='http://pic1.blueidea.com/bbs/topic5.gif'><br>CAO呀,错误了...<br>[确定]</span>");
  24.   document.write("  </div>");
  25.   document.write("</div>");
  26. }
  27. function caoMove(obj)  //实现层的拖移
  28. {
  29.   if(event.button==1)
  30.   {
  31.     var caoX=obj.clientLeft;
  32.     var caoY=obj.clientTop;
  33.     obj.style.pixelLeft=caoX+(event.x-cao_x);
  34.     obj.style.pixelTop=caoY+(event.y-cao_y);
  35.   }
  36. }
  37. </script>
  38. <script language=javascript>
  39. var mycao=new cao888();
  40. mycao.display();
  41. </script>
  42. </body>
  43. </html>
复制代码
您需要登录后才可以回帖 登录 | 入学

本版积分规则

QQ|Archiver|手机版|小黑屋|校园天空成立于2004年2月24日 ( 陕ICP备08000078号-8 )

GMT+8, 2025-5-11 02:12 , Processed in 0.090150 second(s), 17 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表