JS processing countdown, the date can be the current date can also pass 1 time points

Source: Internet
Author: User

JS method
Calculates the remaining time function getendtime () {var endtime= new date (2014,10,16,12,00);//expiry date: October 16, 2014 12:00 var nowtime = new Date () var NMS =endtime.gettime ()-Nowtime.gettime () var nh=math.floor (nms/(1000*60*60))% 24;var Nm=math.floor (nMS/(1000* )% 60;var ns=math.floor (nms/1000)% 60;$ (". Endhour"). HTML (NH); $ (". Endminute"). HTML (NM); $ (". Endsecond"). HTML (NS) ; SetTimeout ("Getendtime ()", 1000);} Window.onload=getendtime;

HTML elements
Distance start: <div class= "Endhour" >00</div> <div class= "Endminute" >00</div> min <div class= " Endsecond ">00</div> s </div>

JS processing countdown, the date can be the current date can also pass 1 time points

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.