html div 布局

<div class="data-box" id="dateShow" data-date="2022/08/21 23:45:24">
	<span class="date-tiem d">00</span>D
	<span class="date-tiem h">00</span>T
	<span class="date-tiem m">00</span>M
	<span class="date-s s">00</span>S
</div>

    <script src="js/jquery-2.1.1.min.js"></script>
    <script src="js/leftTime.min.js"></script>
	<script>
		$(function(){
			//日期倒计时,现在距离下面的日期
			var data_show = $('.data-box');
			function_name($("#dateShow").data("date"),"#dateShow");
			// function_name('2018/02/22 23:45:24','.data-show-box');
			// function_name('2018/02/20 21:43:55','.data-show-box');
			function function_name(time,obj) {
				$.leftTime(time,function(d){
					if(d.status){
						var $dateShow1=$(obj);
						$dateShow1.find(".d").html(d.d);
						$dateShow1.find(".h").html(d.h);
						$dateShow1.find(".m").html(d.m);
						$dateShow1.find(".s").html(d.s);
					}
				});
			}
		});
	</script>

By lxcss

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注