pgheagle
07-31-2012, 03:19 AM
I admit I an a newb when it comes to alot of things.
I have a countdown timer script that I am using for an Alumni website that allows me to show a countdown timer. The output variable of the timer shows based on 3 options, Shows a countdown timer if the time is in the future. It shows a message if the timer is set for the day of the event, and another message if the timer has past the date.
Is there a way so that the output message is a link to a page.
Example: As the script is showing below the timer is set so the event has past. So in the form box it shows "Class of 1965 - There is no reunion information available". Is there a way I can embed the above text with a link that would take you to another page? And is there a way to have the countdown timer have an embeded link as well. What I am trying to do is set it so that no matter what is showing in the form output field has an embedded link to a page for more information.
<form name="count">
<input type="text" size="67" name="count2" style="border:3px double #000000; font-family: Bell MT; font-size: 14pt; color: #000000; font-style:oblique; text-align:center">
</form>
<font color="#FFFF00"><span style="font-size: 1pt">
<script>
//Class of 1965
//change the text below to reflect your own,
var before="the class of 1965 reunion!"
var current="Today is the day of the Class of 1965 Reunion!"
var none="Class of 1965 - There is no reunion information available."
var past="Class of 1965 - There is no reunion information available."
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
function countdown(yr,m,d){
theyear=yr;themonth=m;theday=d
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[m-1]+" "+d+", "+yr
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){
document.forms.count.count2.value=current
return
}
if(yr==0&&m==0&&d==0){
document.forms.count.count2.value=none
return
}
if(dday<0){
document.forms.count.count2.value=past
return
}
else
document.forms.count.count2.value="Only "+dday+ " days until "+before+ " "+m+ "/"+d+ "/"+yr
setTimeout("countdown(theyear,themonth,theday)",1000)
}
//enter the count down date using the format year/month/day
countdown(2012,6,10)
</script>
</span></font>
I have a countdown timer script that I am using for an Alumni website that allows me to show a countdown timer. The output variable of the timer shows based on 3 options, Shows a countdown timer if the time is in the future. It shows a message if the timer is set for the day of the event, and another message if the timer has past the date.
Is there a way so that the output message is a link to a page.
Example: As the script is showing below the timer is set so the event has past. So in the form box it shows "Class of 1965 - There is no reunion information available". Is there a way I can embed the above text with a link that would take you to another page? And is there a way to have the countdown timer have an embeded link as well. What I am trying to do is set it so that no matter what is showing in the form output field has an embedded link to a page for more information.
<form name="count">
<input type="text" size="67" name="count2" style="border:3px double #000000; font-family: Bell MT; font-size: 14pt; color: #000000; font-style:oblique; text-align:center">
</form>
<font color="#FFFF00"><span style="font-size: 1pt">
<script>
//Class of 1965
//change the text below to reflect your own,
var before="the class of 1965 reunion!"
var current="Today is the day of the Class of 1965 Reunion!"
var none="Class of 1965 - There is no reunion information available."
var past="Class of 1965 - There is no reunion information available."
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
function countdown(yr,m,d){
theyear=yr;themonth=m;theday=d
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[m-1]+" "+d+", "+yr
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){
document.forms.count.count2.value=current
return
}
if(yr==0&&m==0&&d==0){
document.forms.count.count2.value=none
return
}
if(dday<0){
document.forms.count.count2.value=past
return
}
else
document.forms.count.count2.value="Only "+dday+ " days until "+before+ " "+m+ "/"+d+ "/"+yr
setTimeout("countdown(theyear,themonth,theday)",1000)
}
//enter the count down date using the format year/month/day
countdown(2012,6,10)
</script>
</span></font>