作者:阿凡达0205 | 来源:互联网 | 2023-08-23 19:42
<html lang &#61;"en" > <head > <meta charset &#61;"UTF-8" > <title > 商城倒计时title ><style > *{margin : 0 px ;padding : 0 px }body {width : 100 % ;height : 100 % ;background : #333 ;} .box {width :200 px ;height :280 px ;margin : 0 auto ;background : url("../image/countdownBg.png" ) no-repeat center ;background-size : 100 % 100 % ;margin-top :100 px }.countDown {padding :20 px 0 }.countDown .title {font-size :34 px ;color : #ffffff ;text-align : center }.countDown .titleEn {font-size : 20 px ;text-align : center ;color : rgba(255 ,255 ,255 ,0.3 ) ;} .countDown .bolt {width : 20 px ;height : 35 px ;background : url(../image/bolt.png) no-repeat center ;margin : 20 px auto ;} .countDown .countDownOver {font-size : 16 px ; text-align : center ;color : #ffffff ;} .countDown .countDownTime {width : 175 px ;height : 40 px ;background : url(../image/countDownTime.png) no-repeat center ; margin : 20 px auto 0 auto ;} .countDown .countDownTime p { font-size : 26 px ;color : #ffffff ;font-weight : bold ; float : left ;width : 40 px ;height : 40 px ;text-align : center ;line-height : 40 px ;margin-right : 5 px ;} .countDown .countDownTime p :last-child {margin-right : 0 px } style >head ><body > <div class &#61;"box" > <div class &#61;"countDown" > <h1 class &#61;"title" > 阳光采购h1 ><p class &#61;"titleEn" > FLASH DEALSp ><div class &#61;"bolt" > div ><p class &#61;"countDownOver" > p ><div class &#61;"countDownTime clearfix" > div >div >div >body ><script src &#61;"../js/jquery-2.2.4.min.js" > script ><script > $(function () {var start_time&#61;new Date ("2018" ,"7" ,"8" ,"14" ); var end_time&#61;new Date ("2018" ,"7" ,"8" ,"14" ); function lastTime (times,nowTime) { var differenceTime&#61;-480 -nowTime.getTimezoneOffset(); var leftTime&#61;(times.getTime()-nowTime.getTime()&#43;differenceTime*60000 ); var day&#61;Math .floor(leftTime/(1000 *60 *60 *24 ));var hour &#61; Math .floor(leftTime / (1000 * 3600 )) - (day * 24 );var minute &#61; Math .floor(leftTime / (1000 * 60 )) - (day * 24 * 60 ) - (hour * 60 );var second &#61; Math .floor(leftTime / (1000 )) - (day * 24 * 60 * 60 ) - (hour * 60 * 60 ) - (minute * 60 );$(&#39;.countDownTime&#39; ).html(&#39;&#39;
&#43;(day<10 ?"0" &#43;day:day)&#43;&#39;
&#39;&#43;(hour<10 ?"0" &#43;hour:hour)&#43;&#39;
&#39;&#43;(minute<10 ?"0" &#43;minute:minute)&#43;&#39;
&#39;&#43;(second<10 ?"0" &#43;second:second)&#43;&#39;
&#39;)}
function setLeftTime () {var now_Time&#61;
new Date ();
var veracityTime&#61;now_Time.getMinutes() &#43;
&#39;:&#39; &#43; now_Time.getSeconds() &#43;
&#39;:&#39; &#43; now_Time.getMilliseconds();console.log(veracityTime);
if (now_Time