网站首页  汉语字词  英语词汇  考试资料  写作素材  旧版资料

请输入您要查询的范文:

 

标题 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[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>
随便看

 

在线学习网范文大全提供好词好句、学习总结、工作总结、演讲稿等写作素材及范文模板,是学习及工作的有利工具。

 

Copyright © 2002-2024 cuapp.net All Rights Reserved
更新时间:2025/5/18 5:52:02