右下角提示框 弹出

前台测试页面:

  1. <html xmlns="http://www.w3.org/1999/xhtml">
  2. <head runat="server">
  3.     <title>lxl</title>
  4.     <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
  5.     <script language="javascript" type="text/javascript" src="jScript.js"></script>
  6.     <script language="javascript" type="text/javascript" src="AJAX_JS.js"></script>
  7.     <script language="javascript" type="text/javascript">
  8.     function fun()
  9.     {
  10.         var userName=document.getElementById("txtname").value;
  11.         ajax.get("Handler.ashx?id="+escape(userName));
  12.     }
  13.     </script>
  14. </head>
  15. <body onload="document.getElementById('tip').style.height='0px'">
  16.     <form id="form1" runat="server">
  17.         <div id="shadow">
  18.         </div>
  19.         <div id="detail">
  20.             详细内容~~!!
  21.         </div>
  22.         <div id="tip">
  23.             <h1>
  24.                 <a href="javascript:void(0)" onclick="start()">×</a>您有新消息</h1>
  25.             <p>
  26.                 <a href="javascript:void(0)" onclick="showwin()">点击这里查看详细</a></p>
  27.         </div>
  28.         <p>
  29.             <a href="#" onclick="start()">点击这里测试</a><br />
  30.         </p>
  31.     </form>
  32. </body>
  33. </html>

js脚本:

  1. var handle; 
  2. function start() 
  3. var obj = document.getElementById("tip"); 
  4. if (parseInt(obj.style.height)==0) 
  5. { obj.style.display="block"
  6. handle = setInterval("changeH('up')",2); 
  7. }else 
  8. handle = setInterval("changeH('down')",2) 
  9. function changeH(str) 
  10. var obj = document.getElementById("tip"); 
  11. if(str=="up"
  12. if (parseInt(obj.style.height)>200) 
  13. clearInterval(handle); 
  14. else 
  15. obj.style.height=(parseInt(obj.style.height)+8).toString()+"px"
  16. if(str=="down"
  17. if (parseInt(obj.style.height)<8) 
  18. { clearInterval(handle); 
  19. obj.style.display="none"
  20. else 
  21. obj.style.height=(parseInt(obj.style.height)-8).toString()+"px"
  22. function showwin() 
  23. document.getElementsByTagName("html")[0].style.overflow = "hidden"
  24. start(); 
  25. document.getElementById("shadow").style.display="block"
  26. document.getElementById("detail").style.display="block"
  27. function recover() 
  28. document.getElementsByTagName("html")[0].style.overflow = "auto"
  29. document.getElementById("shadow").style.display="none"
  30. document.getElementById("detail").style.display="none"

css样式:

  1. *
  2. {
  3.     margin0px;
  4.     padding0px;
  5. }
  6. html, body
  7. {
  8.     height100%;
  9. }
  10. body
  11. {
  12.     font-size14px;
  13.     line-height24px;
  14. }
  15. #tip
  16. {
  17.     positionabsolute;
  18.     right: 0px;
  19.     bottom: 0px;
  20.     height0px;
  21.     width180px;
  22.     border1px solid #CCCCCC;
  23.     background-color#eeeeee;
  24.     padding1px;
  25.     overflowhidden;
  26.     displaynone;
  27.     font-size12px;
  28.     z-index10;
  29. }
  30. #tip p
  31. {
  32.     padding6px;
  33. }
  34. #tip h1#detail h1
  35. {
  36.     font-size14px;
  37.     height25px;
  38.     line-height25px;
  39.     background-color#0066CC;
  40.     color#FFFFFF;
  41.     padding0px 3px 0px 3px;
  42.     filter: Alpha(Opacity=100);
  43. }
  44. #tip h1 a, #detail h1 a
  45. {
  46.     floatright;
  47.     text-decorationnone;
  48.     color#FFFFFF;
  49. }
  50. #shadow
  51. {
  52.     positionabsolute;
  53.     width100%;
  54.     height100%;
  55.     background-color#000000;
  56.     z-index11;
  57.     filter: Alpha(Opacity=70);
  58.     displaynone;
  59.     overflowhidden;
  60. }
  61. #detail
  62. {
  63.     width500px;
  64.     height200px;
  65.     border3px double #ccc;
  66.     background-color#FFFFFF;
  67.     positionabsolute;
  68.     z-index30;
  69.     displaynone;
  70.     left: 30%;
  71.     top: 30%;
  72. }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值