我的时间藏不起来

时间:2018-07-01 13:53:17

标签: php css

嘿,我正在时间事件页面上工作,事件时间结束后,我的事件必须为“显示:无”。但是,例如,在键入“ 6:45”之类的内容时,它显示op,好像时间已经过去了。

在我的示例中,我使用红色背景制作了“显示:隐藏”,以便为大家更好地使用。

希望您能在发现错误的途中为我提供帮助。

$ curl -v http://shmukler.example.com/solar
*   Trying 192.168.99.101...
* Connected to shmukler.example.com (192.168.99.101) port 80 (#0)
> GET /solar HTTP/1.1
> Host: shmukler.example.com
> User-Agent: curl/7.43.0
> Accept: */*
> 
< HTTP/1.1 503 Service Temporarily Unavailable
< Server: nginx/1.13.7
< Date: Sun, 01 Jul 2018 13:49:38 GMT
< Content-Type: text/html
< Content-Length: 213
< Connection: keep-alive
< 
<html>
<head><title>503 Service Temporarily Unavailable</title></head>
<body bgcolor="white">
<center><h1>503 Service Temporarily Unavailable</h1></center>
<hr><center>nginx/1.13.7</center>
</body>
</html>
* Connection #0 to host shmukler.example.com left intact
function timeit() {
    var t = [],
        e = new Date;
    Date.prototype.yyyymmdd = function() {
        var t = this.getMonth() + 1,
            e = this.getDate();
        return [this.getFullYear(), (t > 9 ? "" : "0") + t, (e > 9 ? "" : "0") + e].join("-")
    };
    var i = e.yyyymmdd();
    if ($(".timeit").each(function() {
            function n(i) {
                var n = i - e;
                864e5 > n && n > 1e3 && t.push(n)
            }

            function a(t) {
                var e, i = /^\s*(\d{4})-(\d\d)-(\d\d)?.(\d\d)?.(\d\d)\s*$/,
                    n = new Date(NaN);
                t.substr(0, t.indexOf(" "));
                return parts = i.exec(t), parts && (e = +parts[2], n.setFullYear(parts[1], e - 1, parts[3]), e != n.getMonth() + 1 && n.setTime(NaN), n = new Date(parts[1], e - 1, parts[3], parts[4], parts[5])), n
            }

            function r(t, n) {
                if (t) {
                    String(t).length < 6 && String(t).indexOf(":") > -1 && (t = i + " " + String(t)), -1 == String(t).indexOf(":") && (t += " 00:00");
                    var r = t.split(":"),
                        s = String(r.slice(0, 1)),
                        d = s.substr(s.length - 2),
                        o = r.slice(1),
                        l = 24 > d && 60 > o ? !0 : !1,
                        u = new Date(t);
                    if ("Invalid Date" == u) var u = a(t);
                    return "Invalid Date" != u && l || $(n).addClass("error").attr("title", '"' + t + '" date is incorrect; please use YYYY-MM-DD HH:MM format'), u.getTime()
                }
                return e.getTime()
            }
            var s = $(this).data("end"),
                d = $(this).data("start"),
                o = r(d, this),
                l = r(s, this);
            n(o), n(l), l > o && (o > e || e > l) || o > l && o >= e && e >= l ? $(this).addClass("hidden") : $(this).removeClass("hidden")
        }), t.length > 0) {
        var n = Math.min.apply(null, t);
        console.log("next run of timeit function is in " + n / 1e3 + "seconds"), setTimeout(function() {
            timeit()
        }, n)
    }
}
timeit();
.hidden {	
	background: red;
}
.error {
	color: red;
}
.time {
	font-weight: bold;
}
.teams {
	padding: 3px 0;
}
.league {
	font-size: 12px;
	margin-bottom: 20px;
}

1 个答案:

答案 0 :(得分:0)

使用display: none隐藏元素并删除元素空间

.hidden {   
    display: none !important;
}

如果您仍然需要元素空间,请使用visibility:hidden

.hidden {   
        visibility:hidden;
    }