使用层弹出对话框

来源:互联网 发布:js数组转化成字符串 编辑:程序博客网 时间:2024/04/28 14:40
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=gbk"/>
  5. </head>
  6. <body>
  7. <a href="javascript:showBox();">忘记了密码?</a>
  8. <div id="box" style="display:none;height:auto !important; height:150px; min-height:150px; width:320px; top:100px; left:150px; position:absolute;FILTER: alpha(opacity=0); opacity:0;border:1px #CCCCCC solid; padding:10px; text-align:left; line-height:24px; background-color:#FAFCFD; z-index:999; ">
  9. <table width="100%" border="0" cellspacing="0" cellpadding="5">
  10.   <tr>
  11.     <td align="right"><a href="javascript:GradientClose();">[关闭]</a></td>
  12.   </tr>
  13.   <tr>
  14.     <td>若您忘记密码,职业帆的客服人员可以帮您找回密码!</td>
  15.   </tr>
  16.   <tr>
  17.     <td>客服人员的联系方式:</td>
  18.   </tr>
  19.   <tr>
  20.     <td>1.<img src="image/mail.gif" width="15" height="11" align="absmiddle" /> 电子邮箱:vsail@oafar.com</td>
  21.   </tr>
  22.   <tr>
  23.     <td>   请在邮件中注明您的会员名,会员类型,以及联系方式。</td>
  24.   </tr>
  25.   <tr>
  26.     <td>2.<img src="image/telepone.gif" width="16" height="16" align="absmiddle" /> 电  话:0571-28931325</td>
  27.   </tr>
  28. </table>
  29. </div>
  30. <SCRIPT language=javascript>
  31. var intDelay=50; //设置显示速度,越大越慢
  32. var intInterval=10
  33. var box = document.getElementById("box");
  34. var isIE = /msie/.test(navigator.userAgent.toLowerCase());
  35. function showBox(){
  36. if(isIE)
  37. box.filters.alpha.opacity=0
  38. else
  39. box.style.opacity=0;
  40. box.style.display="block"
  41. GradientShow();
  42. function GradientShow() 
  43. if(isIE){
  44. box.filters.alpha.opacity+=intInterval; 
  45. if (box.filters.alpha.opacity<100
  46. setTimeout(GradientShow,intDelay);  
  47. }else{
  48. box.style.opacity=parseFloat(intInterval/100)+parseFloat(box.style.opacity);
  49. if (box.style.opacity<1)
  50. setTimeout(GradientShow,intDelay);
  51. }
  52. }
  53. function GradientClose() 
  54. if(isIE){
  55. box.filters.alpha.opacity-=intInterval
  56. if (box.filters.alpha.opacity>0)
  57. setTimeout(GradientClose,intDelay); 
  58. else 
  59. box.style.display="none";
  60. }else{
  61. box.style.opacity=parseFloat(box.style.opacity)-parseFloat(intInterval/100);
  62. if (box.style.opacity>0)
  63. setTimeout(GradientClose,intDelay); 
  64. else 
  65. box.style.display="none";
  66. }
  67. }
  68. </SCRIPT>
  69. </body>
  70. </html>
原创粉丝点击