/    Sign up×
Community /Pin to ProfileBookmark

Countdown Looper?

Does anyone have any html for a countdown that loops?
I’m trying to have a countdown that resets every monday at 6pm, if anyone could make it that specific! ?

to post a comment
HTML

2 Comments(s)

Copy linkTweet thisAlerts:
@rootApr 23.2018 — This is not a code request site, you will have to provide cose you have written already and explain what it is that isn't working and you will get help that way ?
Copy linkTweet thisAlerts:
@SempervivumApr 23.2018 — This shoud do what you require: <script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="js/jquery.countdown.js"></script>
<div id="countdown"></div>
<script>
var tohour = 18;
var toweekday = 1;
function startCountdown() {
var now = new Date();
var day = now.getDay();
if (day == toweekday) {
if (now.getHours() < tohour) {
var todate = now.getDate();
} else {
var todate = now.getDate() + 7;
}
} else {
var todate = now.getDate() + ((8 - day) % 7);
}
var totime = new Date(now.getFullYear(), now.getMonth(), todate, tohour, 0, 0);
$("#countdown").countdown(totime, function (event) {
$(this).text(
event.strftime('%-d days %H:%M:%S')
).on('finish.countdown', startCountdown);
});
}
startCountdown();
</script>
Dowload the script jquery.countdown.js from here:

http://hilios.github.io/jQuery.countdown/
×

Success!

Help @Abigfail spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.26,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...