javascript - countdown.js setting it to midday -
i discovered (countdown.js) beautiful script. not documented. have huge difficulty in trying understand algorithm.
my goal trying set counter 1 used amazon delivery time left.
so should countdown until midday , reset @ midday next midday. , changes text showed amazon.

example
june 15, 8.00 am; timer should this:
want tomorrow, june 16? order within 4 hrs 0 mins , choose one-day shipping @ checkout.
june 15, 1.00 pm; timer should this:
want on june 17? order within 23 hrs 0 mins , choose one-day shipping @ checkout.
i hope i'm clear enough. thank in advance.
here example took site ends @ midnight:
<html> <head> </head> <body> <h4 id="midnight-countdown"></h4> <script src="https://smalldo.gs/js/countdown.min.js"></script> <script> var clock1 = document.getelementbyid("midnight-countdown"), tdy = new date(); clock1.innerhtml = countdown(new date(tdy.getfullyear(), tdy.getmonth(), tdy.getdate() + 1)).tostring(); setinterval(function() { clock1.innerhtml = countdown(new date(tdy.getfullyear(), tdy.getmonth(), tdy.getdate() + 1)).tostring(); }, 1000); </script> </body> </html>
please include full time! not date. syntax here:
var timespan = countdown(start|callback, end|callback, units, max, digits); in code:
<h4 id="midnight-countdown"></h4> </blockquote> <p>here how custom live countdown on page using pure javascript (no jquery needed).</p> <script src="https://smalldo.gs/js/countdown.min.js"></script> <script> var clock1 = document.getelementbyid("midnight-countdown") , tdy = new date(); clock1.innerhtml = countdown(new date(tdy.getfullyear(), tdy.getmonth(), tdy.getdate() + 1, tdy.gethours(), tdy.getminutes()) ).tostring(); setinterval(function(){ clock1.innerhtml = countdown(new date(tdy.getfullyear(), tdy.getmonth(), tdy.getdate() + 1, tdy.gethours(), tdy.getminutes()) ).tostring(); }, 1000); </script>
Comments
Post a Comment