您的位置:首页 > 编程语言

hta实现涂鸦效果代码

2008-06-21 00:13 393 查看
<html>      <head>      <hta:APPLICATION      CAPTION="no"      SCROLL="no"      SHOWINTASKBAR="no"      INNERBORDER="no"      CONTEXTMENU="no"      BORDER="none"      SINGLEINSTANCE="yes"      WINDOWSTATE="maximize"      >      <title></title>      <script>      var timer = 100;      var randDiv = new Array(100);      window.onload = function()      {           for(var i = 0; i < randDiv.length; i++)           {                   randDiv[i] = document.createElement("DIV");                   randDiv[i].style.cssText = "filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50);";                   randDiv[i].style.position = "absolute";                   randDiv[i].style.background = GetRandomColor();                   document.body.appendChild(randDiv[i]);           }           Fun();      }      function Fun()      {           for(var i = 0; i < randDiv.length; i++)           {                   randDiv[i].style.top = Math.floor(Math.random() * window.screen.height);                   randDiv[i].style.left = Math.floor(Math.random() * window.screen.width);                   randDiv[i].style.width = Math.floor(Math.random() * 100);                   randDiv[i].style.height = Math.floor(Math.random() * 100);                   randDiv[i].style.background = GetRandomColor();           }           setTimeout("Fun()", timer);      }      function GetRandomColor()      {           var r = Math.floor(Math.random() * 255).toString(16);           var g = Math.floor(Math.random() * 255).toString(16);           var b = Math.floor(Math.random() * 255).toString(16);           r = r.length == 1 ? "0" + r : r;           g = g.length == 1 ? "0" + g : g;           b = b.length == 1 ? "0" + b : b;           return "#" + r + g + b;      }      </script>      </head>      <body>      </body>      </html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  hta 涂鸦