国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 編程 > HTML > 正文

hta實(shí)現(xiàn)的涂鴉效果

2020-01-25 19:40:36
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
hta:HTML Applications  
hta是html的可執(zhí)行程序,制作很簡(jiǎn)單,將文件*.htm改為*.hta就可以了。 
不過(guò)hta有自己獨(dú)有的標(biāo)簽<hta>,并可設(shè)置其屬性達(dá)到很不錯(cuò)的效果。 
hta是制作小程序絕佳選擇。 
下面是一個(gè)例子,幾天前在公司無(wú)聊時(shí)寫的。 
代碼: 
復(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>
 
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 西昌市| 锡林郭勒盟| 华坪县| 宝兴县| 邳州市| 个旧市| 潞城市| 凤城市| 仁布县| 揭阳市| 泰宁县| 昌图县| 深圳市| 民和| 永靖县| 界首市| 定远县| 鹤岗市| 自贡市| 阳江市| 辽阳县| 固始县| 十堰市| 龙山县| 沙河市| 鹿泉市| 额敏县| 桑日县| 黄冈市| 远安县| 无极县| 汝阳县| 万全县| 十堰市| 西盟| 昌江| 桃园县| 墨脱县| 靖西县| 牙克石市| 嘉禾县|