jQuery倒计时代码(超简单)
程序员文章站
2023-12-04 08:01:03
具体代码如下所示:
具体代码如下所示:
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>title</title> </head> <body> <span class="timespan"></span> </body> <script src="libs/jquery-1.11.3.js"></script> <script> var starttime = new date("2017/11/20"); 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 + "秒"); }, 1000); </script> </html>
以上所述是小编给大家介绍的jquery倒计时代码(超简单),希望对大家有所帮助