<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<style type="text/css">
.timespan{display: ;}
.body{width: 50px; height: 50px; background-color: red;}
.body:hover .timespan{display: block;}
</style>
</head>
<body>
<h1>halo</h1>
<div>
</div>
<div class="day"></div>
<div class="body">6</div>
<span class="timespan"></span>
</body>
<body>
<script>
var starttime = new Date("2019/2/4");
setInterval(function () {
/*当前时间*/
var nowtime = new Date();
var time = starttime - nowtime;
var day = parseInt(time / 1000 / 60 / 60 / 24);
var hour = parseInt(time / 1000 / 60 / 60 % 24);
var minute = parseInt(time / 1000 / 60 % 60);
var seconds = parseInt(time / 1000 % 60);
$('.timespan').html(day + "天" + hour + "小时" + minute + "分钟" + seconds + "秒");
$('.day').html(time + "天");
}, 1000);
</script>
</html>