• 颜色渐变


    颜色渐变:

    代码
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <style type="text/css">
    #block
    { width:400px;}
    </style>
    <script type="text/javascript">
        window.onload
    =function(){
            document.getElementById(
    "block").style.backgroundColor="#ffffff";
            setTimeout(
    "colorFlash(255)",300);
        }
        
        
    function colorFlash(newColor){
            
    var hexVal=newColor.toString(16);
            
            
    if(hexVal.length<2){
                hexVal
    ="0"+hexVal;
            }
            
            
    var colorString="#ffff"+hexVal;
            
    var blockDiv=document.getElementById("block");
            blockDiv.style.backgroundColor
    =colorString;
            
    if(newColor>0){
                newColor
    -=5;
                setTimeout(
    "colorFlash("+newColor+")",50);
            }
        }
    </script>
    </head>
    <body>
    <div id="block">
    <p>hello</p>
    </div>
    </body>
    </html>
  • 相关阅读:
    抓包之网络分析器- Wiresshark
    IT 技术网站收集
    XAMPP Apache + MariaDB + PHP + Perl
    http://101.132.165.115/
    LNMP 网站搭建
    10X Genomics : Single Cell Gene Expression
    PacBio下机数据如何看?
    光模块
    ubuntu 'yuan' update
    Perl 中 `cmd` 和system"cmd"的区别
  • 原文地址:https://www.cnblogs.com/Fskjb/p/1761906.html
Copyright © 2020-2023  润新知