Home > Web Front-end > JS Tutorial > body text

3 examples of js code to implement web page countdown and website running time functions_javascript skills

WBOY
Release: 2016-05-16 16:52:34
Original
1468 people have browsed it

1. jQuery.countdown plug-in

Display format: 50 weeks, 01 days, 07 hours, 18 minutes and 41 seconds (seconds are running seconds)
A page can have multiple countdowns Instance, can be stopped and started, it doesn't offer too many features, but the time format and the size of the output can be customized.
The latest version v2.0.2, official address http://hilios.github.io/jQuery.countdown/
For example:

Copy code The code is as follows:






Output result: 50 weeks, 01 days, 07 hours, 18 minutes and 41 seconds

Note: If you need the total number of days left, use %D, parameter description:

Copy code The code is as follows:

Y: "years"
m: "months"
w: "weeks"
d: "days"
D: "totalDays"

H: "hours"
M: "minutes"
S: "seconds"


2. Display format: There are still days before the end time: 00 days 05 Hours, 25 minutes and 30 seconds (seconds are running seconds)

Copy code The code is as follows:



3. Display format: Running 0 years, 1 day, 0 hours, 4 minutes and 35 seconds (seconds are running seconds)

Copy the code The code is as follows:



Related labels:
js
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template