Here is some nifty script that you can copy and paste to make your own countdown.
The easiest way to do this in Blogger is to go to your layouts tab, click on add a page element and then add this as html.
You will need to alter the bolded red items to fit your needs.
<script>
//change the text below to reflect your own,
var before="New Years!"
var current="Today is New Years! Happy 2009"
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
function countdown(yr,m,d){
var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy
var futurestring=montharray[m-1]+" "+d+", "+yr
var difference=(Math.round((Date.parse(futurestring)-Date.parse(todaystring))/(24*60*60*1000))*1)
if (difference==0)
document.write(current)
else if (difference>0)
document.write("Only "+difference+" days until "+before)
}
//enter the date you are counting down to using the format year/month/day
countdown(2009,1,1 )
</script>
0 comments:
Post a Comment