Add a countdown timer to your item description
<!-- Start of section to be inserted into description -->
<script language="JavaScript1.2">
<!--// Ebay countdown timer script II- Modified for ebay auction by baconbuttie - Original script © Dynamic Drive (www.dynamicdrive.com)
function setcountdown(theyear,themonth,theday,thehour,themin,thesec){
yr=theyear;mo=themonth;da=theday;hr=thehour;min=themin;sec=thesec
}
// modify the following lines to change the appearance of your timer
var occasion="Auction End"
var message_on_occasion="Auction Ended ! Did you bid in time ?"
var countdownwidth='520px'
var countdownheight='35px'
var countdownbgcolor='lightyellow'
var opentags='<font face="Verdana"><small>'
var closetags='</small></font>'
// ********* don't change anything from here !! *************
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
var crosscount=''
function start_countdown(){
if (document.layers)
document.countdownnsmain.visibility="show"
else if (document.all||document.getElementById)
crosscount=document.getElementById&&!document.all?document.getElementById("countdownie") : countdownie
countdown()
}
if (document.all||document.getElementById)
document.write('<center><span id="countdownie" style="width:'+countdownwidth+'; background-color:'+countdownbgcolor+'"></span></center>')
function countdown(){
var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
futurestring=montharray[mo-1]+" "+da+", "+yr+" "+hr+":"+min+":"+sec
dd=Date.parse(futurestring)-Date.parse(todaystring)
dday=Math.floor(dd/(60*60*1000*24)*1)
dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
if(dday<=0&&dhour<=0&&dmin<=0&&dsec<=1&&todayd==da){
if (document.layers){
document.countdownnsmain.document.countdownnssub.document.write(opentags+message_on_occasion+closetags)
document.countdownnsmain.document.countdownnssub.document.close()
}
else if (document.all||document.getElementById)
crosscount.innerHTML=opentags+message_on_occasion+closetags
return
}
else if (dday<=-1){
if (document.layers){
document.countdownnsmain.document.countdownnssub.document.write(opentags+"Occasion already passed! "+closetags)
document.countdownnsmain.document.countdownnssub.document.close()
}
else if (document.all||document.getElementById)
crosscount.innerHTML=opentags+"Auction already ended ! "+closetags
return
}
else{
if (document.layers){
document.countdownnsmain.document.countdownnssub.document.write(opentags+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds left until "+occasion+closetags)
document.countdownnsmain.document.countdownnssub.document.close()
}
else if (document.all||document.getElementById)
crosscount.innerHTML=opentags+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds left until "+occasion+closetags
}setTimeout("countdown()",1000)}
// added by baconbuttie 14/06/02 for auto start // added BST and GMT filter 15/06/02
if(document.all||document.getElementById){if(document.title.substring((document.title.indexOf(")")-4),((document.title.indexOf(")")-4)+3))=="BST"||document.title.substring((document.title.indexOf(")")-4),((document.title.indexOf(")")-4)+3))=="GMT"){dateArray=(((document.title.substring((document.title.indexOf("("))+6,(document.title.indexOf(")"))-5)).substring(0,((document.title.substring((document.title.indexOf("("))+6,(document.title.indexOf(")"))-5)).indexOf(":",0)-4)+1)).split('-'));dateArray[2]=("20"+dateArray[2]);switch(dateArray[1]){case"Jan":;dateArray[1]="01";break;case"Feb":;dateArray[1]="02";break;case"Mar":;dateArray[1]="03";break;case"Apr":;dateArray[1]="04";break;case"May":;dateArray[1]="05";break;case"Jun":;dateArray[1]="06";break;case"Jul":;dateArray[1]="07";break;case"Aug":;dateArray[1]="08";break;case"Sep":;dateArray[1]="09";break;case"Oct":;dateArray[1]="10";break;case"Nov":;dateArray[1]="11";break;case"Dec":;dateArray[1]="12";break;}timeArray=((document.title.substring((document.title.indexOf("("))+6,(document.title.indexOf(")"))-5)).substring(((((document.title.substring((document.title.indexOf("("))+6,(document.title.indexOf(")"))-5)).indexOf(":",0)-4)+2)),(((((document.title.substring((document.title.indexOf("("))+6,(document.title.indexOf(")"))-5)).indexOf(":",0)-4)+2))+10))).split(":");setcountdown(dateArray[2],dateArray[1],dateArray[0],timeArray[0],timeArray[1],timeArray[2]);window.onload=start_countdown}}
//-->
</script>
<center>
<ilayer id="countdownnsmain" width=&{countdownwidth}; height=&{countdownheight}; bgColor=&{countdownbgcolor}; visibility=hide><layer id="countdownnssub" width=&{countdownwidth}; height=&{countdownheight}; left=0 top=0></layer></ilayer>
<table bgcolor=black border=1><tr><td><font size=-2>Script Provided by <a href="http://www.ukauctionhelp.co.uk" target="_blank">UK Auction Help</a></font></td></tr></table></center>
<!-- End of section to be inserted into description -->
|
To use this script in your auction listing copy the code above into the item
description box
in eBay and submit your item.
An earlier version with manual date/time setup for use on other web pages
can be found
here (Users outside the UK should use the old version, an international version of the code above is in production)
Javascript by baconbuttie
|