hta实现的涂鸦效果

(编辑:jimmy 日期: 2024/9/21 浏览:2)

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[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>

一句话新闻

微软与英特尔等合作伙伴联合定义“AI PC”:键盘需配有Copilot物理按键
几个月来,英特尔、微软、AMD和其它厂商都在共同推动“AI PC”的想法,朝着更多的AI功能迈进。在近日,英特尔在台北举行的开发者活动中,也宣布了关于AI PC加速计划、新的PC开发者计划和独立硬件供应商计划。
在此次发布会上,英特尔还发布了全新的全新的酷睿Ultra Meteor Lake NUC开发套件,以及联合微软等合作伙伴联合定义“AI PC”的定义标准。