Hvordan dælen får jeg alt output (xxx dage til min fødselsdag) til at stå
med hvid skrift istedet for sort.
På forhånd tak
Gunnar007
<script type="text/javascript">
var today=new Date()
//Enter the occasion's MONTH (1-12) and DAY (1-31):
var theoccasion=new Date(today.getFullYear(), 11, 22)
//Customize text to show before and on occasion. Follow grammer below:
var beforeOccasionText="til min fødselsdag"
var onOccasiontext="Det er min fødselsdag idag !!!"
var monthtext=new
Array("Jan","Feb","Mar","April","Maj","Juni","Juli","Aug","Sep","Okt","Nov",
"Dec")
theoccasion.setMonth(theoccasion.getMonth()-1) //change to 0-11 month format
var showdate="("+monthtext[theoccasion.getMonth()]+"
"+theoccasion.getDate()+")" //show date of occasion
var one_day=1000*60*60*24
var calculatediff=""
calculatediff=Math.ceil((theoccasion.getTime()-today.getTime())/(one_day))
if (calculatediff<0){ //if bday already passed
var nextyeartoday=new Date()
nextyeartoday.setFullYear(today.getFullYear()+1)
calculatediff=Math.ceil((nextyeartoday.getTime()-today.getTime())/(one_day)+
calculatediff)
}
//Display message accordingly
var pluraldayornot=(calculatediff==1)? "dag" : "dage"
if (calculatediff>0)
document.write("<b>"+calculatediff+" "+pluraldayornot+"
"+beforeOccasionText+"</b>")
else if (calculatediff==0)
document.write("<b>"+onOccasiontext+" "+showdate+"!</b>")
</script>
|