hta實(shí)現(xiàn)的涂鴉效果
更新時(shí)間:2007年03月30日 00:00:00 作者:
hta:HTML Applications
hta是html的可執(zhí)行程序,制作很簡(jiǎn)單,將文件*.htm改為*.hta就可以了。
不過(guò)hta有自己獨(dú)有的標(biāo)簽<hta>,并可設(shè)置其屬性達(dá)到很不錯(cuò)的效果。
hta是制作小程序絕佳選擇。
下面是一個(gè)例子,幾天前在公司無(wú)聊時(shí)寫(xiě)的。
代碼:
<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>
hta是html的可執(zhí)行程序,制作很簡(jiǎn)單,將文件*.htm改為*.hta就可以了。
不過(guò)hta有自己獨(dú)有的標(biāo)簽<hta>,并可設(shè)置其屬性達(dá)到很不錯(cuò)的效果。
hta是制作小程序絕佳選擇。
下面是一個(gè)例子,幾天前在公司無(wú)聊時(shí)寫(xiě)的。
代碼:
復(fù)制代碼 代碼如下:
<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>
相關(guān)文章
hta編寫(xiě)的軟件管理工具0.1(IE7.0測(cè)試通過(guò))
程序初始化是建立與本文件同名后綴為mdb的數(shù)據(jù)庫(kù)2009-05-05NCC Tools(never code counter tools) V1.0.1發(fā)布代碼-代碼統(tǒng)計(jì)工具
NCC Tools(never code counter tools) V1.0.1發(fā)布代碼-代碼統(tǒng)計(jì)工具...2006-07-07hta實(shí)現(xiàn)的定時(shí)重啟或關(guān)閉計(jì)算機(jī)的小工具
一個(gè)用于定時(shí)重啟或關(guān)閉計(jì)算機(jī)的小工具,適用于Windows 2K/XP/20032008-06-06如何使一個(gè)HTA位于屏幕中心(Win32_DesktopMonitor)
我們可以調(diào)整(如果需要)窗口大小并使其居中,但這樣做時(shí)會(huì)在屏幕上出現(xiàn)瞬間的閃爍。這并不是太明顯,其實(shí)際結(jié)果就是你所期望的:HTA 會(huì)位于屏幕中心2013-08-08用hta[javascript]寫(xiě)的定時(shí)重啟或關(guān)機(jī)的小工具
用hta[javascript]寫(xiě)的定時(shí)重啟或關(guān)機(jī)的小工具...2007-08-08