First, check all the complete code: [Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]Some html code:You can enter the countdown time in the text box. If the current time is less than the deadline, the system returns normally. Otherwise, the system returns the time from the deadline to the present.Copy codeThe Code is as follows: Javascript code:Copy codeThe Code is as follows:Function
The javascript countdown function implements the Code. For more information, see the following code:
The Code is as follows:
/*** Countdown** @ Author WadeYu* @ Date* @ Copyright boyaa.com*/Var TimeCountDown = function (initTime ){Var day = 0;Var hour = 0;Var minute = 0;Var second = 0;Var timerId = 0;Var self = this;Var fixInitTime = function (){InitTime = par
Online Demo: http://demo.jb51.net/js/2012/mydaojishi/
Package and download: mydaojishi_jb51
Core code:
Copy codeThe Code is as follows: $ (function (){
Var tYear = ""; // input year
Var tMonth = ""; // The input month
Var tDate = ""; // input date
Var iRemain = ""; // Number of milliseconds between start and end
Var sDate = ""; // counting days
Var sHour = ""; // countdown hour
Var sMin = ""; // minutes of countdo
This article describes the JS countdown to the simple implementation of the code, sharing for everyone to reference, specific as follows:
function Timedown (second) {
var month = ', day = ', hour = ', Minute = ';
if (second >= 86400 *) {
month = Math.floor (Second/(86400 * 30)) + ' month ';
Second = second% (86400 *);
}
if (second >= 86400) {
day = Math.floor (second/86400) + ' days
This article mainly introduces jquery's simple countdown implementation method, involving jQuery's scheduled function operations and date and implementation computation techniques, which has some reference value, if you need it, refer to the following example to describe how to implement jquery simple countdown. We will share this with you for your reference. The details are as follows:
Var intDiff = pars
execution {time --; mhandler. post (New runnable () // use it to modify the remaining time displayed in the UI main thread {public void run () {timecount. settext (getinterval (time); // display the remaining time}); try {thread. sleep (1000); // thread sleep for one second. This is the countdown interval} catch (interruptedexception e) {e. printstacktrace () ;}/// below is the countdown end logic mhandler
); Gets the number of minutes,var s =parseint (leftsecond%60); Gets the number of secondsHere the flexible use of the method of the% take Mo, simply speaking, if you are in addition to the result is the number of days, then the result is the number of hours, if you come out of the result is an hour, then the result is the number of minutes, if you remove the result is a minute, then the result is the number of seconds.var hour = day*24+h; This is the
The Verification Code Countdown button application is very common, the blog and you together to write a idcountdownbutton to achieve the verification code countdown effect. You can want to use the ordinary UIButton type button, just need to set its countdown length (if not set, the default is 60 seconds), you can easily realize click Countdownbutton Start
The Code is as follows:
Copy codeThe Code is as follows :/**
* Countdown
*
* @ Author WadeYu
* @ Date
* @ Copyright boyaa.com
*/
Var TimeCountDown = function (initTime ){
Var day = 0;
Var hour = 0;
Var minute = 0;
Var second = 0;
Var timerId = 0;
Var self = this;
Var fixInitTime = function (){
InitTime = parseInt (initTime );
If (isNaN (initTime) | initTime InitTime = 0;
}
};
Var fixZero = function (num ){
During the Chinese new year's holiday, I went through some e-books on my mobile hard drive. I am not used to reading books. I want to read these e-books. Thanks to Chen for urging me all the time. Thank you, brother!
During the start-up phase, a 25-year-old entrepreneur needs to learn a lot and constantly supplement theoretical knowledge to improve his or her practice, it is very difficult to know this truth.
Most of the current entrepreneurial groups are operated by micro-teams and should b
The latest I do not know how to read the desire (may be more stressful, need to rely on reading to improve self-confidence), just because of the team's outstanding performance last year, our 5 team has won the Department of Innovation Project team, won 2000 Yuan Award. Everyone is thinking about how to spend this money, of course, eat a meal must be indispensable, but also do not have a per capita 400 so extravagant, so just want to take a part of the money to buy some books, so as to sustainabl
This article mainly introduces the implementation code of the Countdown Effect of javascript e-commerce website flash sales, master the Date object, and obtain the time, interested friends can refer to the example in this article to describe the implementation code of the Countdown Effect of javascript e-commerce website flash sales. Share it with you for your reference. The details are as follows:
The runn
This paper analyzes the calculation ideas and methods of the different countdown effects, grasps date object dates, obtains the time method, calculates the jet lag method, realizes the different inverted time meter effect.
1. Simple Time display
The date object is explained and the time, minutes, seconds, etc. are obtained by the object, allowing you to freely extract the desired content.
Show Results:
2,
= 12345678 public void addtime (int sum) {//Find the number of days int day = SUM/60/60/24
;
int day_time = sum% 24;
LOG.E ("Hour", Day + "");
LOG.E ("hour", sum% 24 + "");
Find out the hour//int hour = DAY_TIME/60;
int hour_time = day_time% 60;
LOG.E ("Hour", Hour + "");
First get a second value int sec = sum% 60; If more than 60 seconds, get minutes.
(number of seconds) int sec_time = SUM/60;
Then get the
PHP+JS countdown a few seconds and then not move.
There were two problems with a countdown code.
1. The countdown is quite smooth after the refresh but wait a half minute, the countdown starts the card and then does not move, this is why?
2. After the card is refreshed, the
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.