Loading
0

酷炫:让网页中的文字随机变换颜色
被墙跳转TG:@qianhenetwork QQ 851617266

301免备案跳转微信公众号
腾讯云服务器大促销。
华为服务器
酷炫:让网页中的文字随机变换颜色

 
<body>
        <h1 id="color1" style="margin-top:100px">这里的文字会变颜色哦,www.zfcdn.xyz</h1>
        <h1 id="color3" style="margin-top:100px"><a href="https://www.zfcdn.xyz/" target="_blank">这里的文字会变颜色哦,www.zfcdn.xyz</a></h1>

 
        <script>
            function randomHexColor() { //随机生成十六进制颜色
                        return '#' + ('00000' + (Math.random() * 0x1000000 << 0).toString(16)).substr(-6);
                }
                function color_rand()
                {
                        var color1 = document.getElementById('color1');
                        var color2 = document.getElementById('color2');
                        var color3 = document.getElementById('color3');
                        var color4 = document.getElementById('color4');
                        var color_href = document.getElementById('color_href');
                        var color_href2 = document.getElementById('color_href2');
                        
                        var Interval = setInterval(function(){
                                color1.style.color = randomHexColor();
                                color2.style.color = randomHexColor();
                                var a3 = randomHexColor();
                                color3.style.color = a3;
                                color_href.style.color = a3;
                                var a4 = randomHexColor();
                                color4.style.color = a4;
                                color_href2.style.color = a4;
                        },200);
                }
                setTimeout('color_rand()',1000);
        </script>
</body>

 

301免备案跳转微信公众号
华为服务器
腾讯云服务器大促销。

声明:站长码字很辛苦啊,转载时请保留本声明及附带文章链接:https://www.zfcdn.xyz/showinfo-20-423-0.html
亲爱的:被墙域名跳转TG:@qianhenetwork QQ:851617266,可否收藏+评论+分享呢?

最后编辑于:2019-01-26 22:22:05作者:

上一篇:Zblog/Nginx给目录添加反斜杠的伪静态规则方法
下一篇:破解火车头发布模块wpm密码方法