Js_ a simple 30-minute cycle countdown

Source: Internet
Author: User

Spit Groove Section:

Changes in demand are ever-changing, at least until you convince the person who you're dealing with.

Startups are like this, product manager an idea, is to change the change, you change the complexity is not complex, in their eyes are very simple.

Today, a small change in demand, the activity of the countdown to a cycle of 30 minutes countdown, yes, is a cycle of 30 minutes countdown, this activity is endless.

Technical section:

Html

1 <P>Red Envelope expiry date:2     <!--2. Countdown HTML -3     <spanID= "Minute">00</span>points4     <spanID= "Second">00</span>seconds5 </P>

Js

1<!--3. Countdown js-->2<script type= "Text/javascript" >3     varminute = "29";4     varSecond = 59;5SetInterval (function() {6second--;7         if(second = = XX && minute = = 00) {8minute = 29;9Second = 59;Ten};//when the minutes and seconds are 00 o'clock, the value is re-given One         if(Second = = 00) { ASecond = 59; -minute--; -             if(Minute <) minute = "0" +minute; the};//when the second is 00 o'clock, the number of seconds is given back to the value -         if(Second <) Second = "0" +second; -$ ("#minute"). text (minute); -$ ("#second"). Text (second); +}, 1000); -</script>

All code

1<! DOCTYPE html>23 45<meta charset= "UTF-8" >6<title></title>7<!--1. Introduction of Jq-->8<script src= "Http://code.jquery.com/jquery-latest.js" ></script>9Ten  One<body> A<p>Red Envelope expiry date: -<!--2. Countdown html--> -<span id= "Minute" >00</span> min the<span id= "Second" >00</span> sec -</p> -</body> -<!--3. Countdown js--> +<script type= "Text/javascript" > -         varminute = "29"; +         varSecond = 59; ASetInterval (function() { atsecond--; -             if(second = = XX && minute = = 00) { -minute = 29; -Second = 59; -};//when the minutes and seconds are 00 o'clock, the value is re-given -             if(Second = = 00) { inSecond = 59; -minute--; to                 if(Minute <) minute = "0" +minute; +};//when the second is 00 o'clock, the number of seconds is given back to the value -             if(Second <) Second = "0" +second; the$ ("#minute"). text (minute); *$ ("#second"). Text (second); $}, 1000);Panax Notoginseng</script> -  theView Code

Js_ a simple 30-minute cycle countdown

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.