jQuery功能是非常强大的,同时也可以自定义一些常用插件,方便随时调用,添加样式来展示。页面效果图:
<!DOCTYPE html>
<head>
<title>jQuery实现倒计时效果</title>
<script type="text/javascript" src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
$.fn.countDown = function (opt) {
var opt = $.extend({
time : null,
type : 0
}, opt);
var edtime = new Date(opt.time).getTime(), //月份是实际月份-1
edsecond = (edtime - new