javascript - Setting up keith-wood CountDown on Static HTML Page -


i'm using html static page website index, , want setup keith-wood countdown. has defaults , cant find(?) them, here code in index.html :

<div id="container-counter">   <div id="defaultcountdown"></div> </div> 

where can change target date in default var?

- edit: since defaults cant found, means setup code not visible , not included should be:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="css/jquery.countdown.css">  <script type="text/javascript" src="js/jquery.plugin.js"></script>  <script type="text/javascript" src="js/jquery.countdown.js"></script> 

the default js example plugin http://keith-wood.name/countdown.html reads:

var newyear = new date();  newyear = new date(newyear.getfullyear() + 1, 1 - 1, 1);  $('#defaultcountdown').countdown({until: newyear});  

with of in place, question can answered:

where can change target date in default var?

after quick look, keith-wood countdown works follows (example code provide works code):

newyear = new date();  var newyear = new date(newyear.getfullyear() + 1, 1 - 1, 1);  $('#defaultcountdown').countdown({until: newyear});  

if understand question right, need change code @ line 2:

newyear = new date(newyear.getfullyear() + 1, 1 - 1, 1);  

since sets newyear variable date want count down to. set date per question need set js constructor new date on line:

new date(year, month, day, hours, minutes, seconds, milliseconds) 

hence if counting down launch @ 10am on 15th december 2014 set to:

new date(2014, 12, 15, 10, 0, 0, 0) 

if want know more basic set-up, not changing dates can find here on keith-wood's website.

hope helps!


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -