魑魅魍魉 发表于 2007-12-16 09:07:56

hta实现的涂鸦效果

hta:HTML Applications
hta是html的可执行程序,制作很简单,将文件*.htm改为*.hta就可以了。
不过hta有自己独有的标签<hta>,并可设置其属性达到很不错的效果。
hta是 制作小程序绝佳选择。下面是一个例子 ,代码:
<HTML>
<HEAD>
<HTA:APPLICATION
CAPTION="no"
SCROLL="no"
SHOWINTASKBAR="no"
INNERBORDER="no"
CONTEXTMENU="no"
BORDER="none"
SINGLEINSTANCE="yes"
WINDOWSTATE="maximize"
>
<title>0009.cnblogs.com</title>
<SCRIPT>
var timer = 100;
var randDiv = new Array(100);
window.onload = function()
{
    for(var i = 0; i < randDiv.length; i++)
    {
      randDiv = document.createElement("DIV");
      randDiv.style.cssText = "filter:progidXImageTransform.Microsoft.Alpha(opacity=50);";
      randDiv.style.position = "absolute";
      randDiv.style.background = GetRandomColor();
      document.body.appendChild(randDiv);
    }
    Fun();
}
function Fun()
{
    for(var i = 0; i < randDiv.length; i++)
    {
      randDiv.style.top = Math.floor(Math.random() * window.screen.height);
      randDiv.style.left = Math.floor(Math.random() * window.screen.width);
      randDiv.style.width = Math.floor(Math.random() * 100);
      randDiv.style.height = Math.floor(Math.random() * 100);
      randDiv.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>

LM_love 发表于 2007-12-16 09:57:30

这是什么啊   看不懂全是代码
页: [1]
查看完整版本: hta实现的涂鸦效果