• 无限循环色卡


    无限循环色卡

    <!DOCTYPE html>
    <html lang="ch-zn">
    <head>
        <meta charset="UTF-8">
        <title>moban</title>
    
        <style>
        html,body,h1,h2,h3,h4,h5,h6,div,dl,dt,dd,ul,ol,li,p,blockquote,pre,hr,figure,table,caption,th,td,form,fieldset,legend,input,button,textarea,menu{margin:0;padding:0;}
        header,footer,section,article,aside,nav,hgroup,address,figure,figcaption,menu,details{display:block;}
        table{border-collapse:collapse;border-spacing:0;}
        caption,th{text-align:left;font-weight:normal;}
        html,body,fieldset,img,iframe,abbr{border:0;}
        i,cite,em,var,address,dfn{font-style:normal;}
        [hidefocus],summary{outline:0;}
        li{list-style:none;}
        h1,h2,h3,h4,h5,h6,small{font-size:100%;}
        sup,sub{font-size:83%;}
    
        #wrap span{
            float: left;
            margin: 5px;
             150px;
            height: 40px;
            /* background-color: coral; */
            
            line-height: 40px;
            text-align: center;
            font-size: 12px;
            font-weight: bold;
            color: black;
    
        }
    
    
        </style>
    
    </head>
    <body>
    
        <div id="wrap"></div>
    
    
    
        <script src='https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js'></script>
        <script>
    
            (function () {
                    //获取标签权限
                let Wrap = document.getElementById("wrap")
    
                ;
    
                //添加定时器
                setInterval(function(){
                    //随机颜色
                    let WrapColor = randomColor()
                    //添加span标签样式
                    Wrap.innerHTML += `<span style="background-color: ${WrapColor}">${WrapColor}<span>`;
    
                },1000)
    
                //封装随机数函数
                function randomColor(){
    
                    let r = Math.floor(Math.random()*256);
    
                    let g = Math.floor(Math.random()*256);
    
                    let b = Math.floor(Math.random()*256);
    
                    return `rgb(${r},${g},${b})`;
    
                }
    
    
            })();
    
        </script>
    </body>
    <!--
    笔记区域
    
    
    
    
    -->
    
    </html>

  • 相关阅读:
    Zend Studio下调试PHP的一点注意事项
    使用FTP出现中文乱码解决方案
    C++数据类型与C#对应表
    FineUI 开发B/S系统
    c#调用带输出参数的存储过程
    经典FormsAuthenticationTicket 分析
    C# Oracle数据库操作类实例详解
    如何使用C#的Hashtable[哈希表]
    对三层架构的理解
    C# 最简单的三层架构实例 ——转载自网易博客
  • 原文地址:https://www.cnblogs.com/yhy-blog/p/14462022.html
Copyright © 2020-2023  润新知