hta:HTMLApplications
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>
vartimer=100;
varrandDiv=newArray(100);
window.onload=function()
{
for(vari=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();
}
functionFun()
{
for(vari=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);
}
functionGetRandomColor()
{
varr=Math.floor(Math.random()*255).toString(16);
varg=Math.floor(Math.random()*255).toString(16);
varb=Math.floor(Math.random()*255).toString(16);