倒计时切换网页为灰色或恢复正常网页

久伴
久伴
久伴
643
文章
535
评论
2020年4月4日16:17:16 评论 213 1750字阅读5分50秒

倒计时切换网页为灰色代码

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>倒计时</title>
    <style>

    </style>
</head>
<body>
    <div>
        <img src="https://jiubx.com/wp-content/uploads/2020/04/2020040304530377.png" alt="">
    </div>
    <span id="jtime"></span>
</body>
<script>
    function j_time() {
        var jtime = new Date();
        var stoptime= new Date("2020/4/4 16:11:00");//结束时间
        var shenyu=(stoptime.getTime()-jtime.getTime())/1000;
        var oDay = parseInt(shenyu/(24*60*60));
        var oHours  = parseInt(shenyu/(60*60));
        var oMinutes = parseInt((shenyu/60)%60);
        var oSeconds  = parseInt(shenyu%60);
        // console.log(shenyu,oDay,oHours,oMinutes,oSeconds);
        var jspan=document.getElementById("jtime");
        jspan.innerText=oDay+'天'+oHours+'小时'+oMinutes+'分钟'+oSeconds+'秒';
        if(shenyu<0){
            j_html();
            clearInterval(b);
            jspan.innerText="";
        }
    }
    function j_html() {
            var a = document.body.style.filter="grayscale(100%)";
            console.log(a);
    }
 var b=setInterval(j_time,1000);

    j_time();
</script>
</html>

倒计时切换网页为正常颜色代码

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>倒计时</title>
    <style>

    </style>
</head>
<body>
    <div>
        <img src="https://jiubx.com/wp-content/uploads/2020/04/2020040304530377.png" alt="">
    </div>
    <span id="jtime"></span>
</body>
<script>
    function j_time() {
        var jtime = new Date();
        var stoptime= new Date("2020/4/4 16:11:00");//结束时间
        var shenyu=(stoptime.getTime()-jtime.getTime())/1000;
        var oDay = parseInt(shenyu/(24*60*60));
        var oHours  = parseInt(shenyu/(60*60));
        var oMinutes = parseInt((shenyu/60)%60);
        var oSeconds  = parseInt(shenyu%60);
        // console.log(shenyu,oDay,oHours,oMinutes,oSeconds);
        var jspan=document.getElementById("jtime");
        jspan.innerText=oDay+'天'+oHours+'小时'+oMinutes+'分钟'+oSeconds+'秒';
        if(shenyu<0){
            j_html();
            clearInterval(b);
            jspan.innerText="";
        }
    }
    function j_html() {
            var a = document.body.style.filter="grayscale(0%)";
            console.log(a);
    }
 var b=setInterval(j_time,1000);

    j_time();
</script>
</html>
继续阅读
久伴
破解那些无法复制的网站无限复制内容 JavaScript

破解那些无法复制的网站无限复制内容

例如360图书馆是不能复制的,复制必须登录,有的时候为一个知识点去注册实在繁琐 把下方代码加到浏览器console控制台,然后你去网站复制内容就会发现,不在提示登录复制等等一些限制 $=0 如果是新手...
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: