fatbottoms
June 7th, 2005, 09:07 PM
i have a comic website with a cartoon which changes daily. i have a javascript for a 7-day changer, but would like to increase the days up to a month or more if possible.
here's my code for a 7-day change. how would i alter this to increase the days? or if someone could write some new code for daily image changer (up to a month), it would be greatly appreciated. here's my site, if you'd like to take a look. http://fatbottoms.atspace.com
<script>
<!--
var mondayimg="fb124.gif"
var tuesdayimg="fb125.gif"
var wednesdayimg="fb126.gif"
var thursdayimg="fb127.gif"
var fridayimg="fb121.gif"
var saturdayimg="fb122.gif"
var sundayimg="fb123.gif"
var mydate=new Date()
var today=mydate.getDay()
if (today==1)
document.write('<img src="'+mondayimg+'">')
else if (today==2)
document.write('<img src="'+tuesdayimg+'">')
else if (today==3)
document.write('<img src="'+wednesdayimg+'">')
else if (today==4)
document.write('<img src="'+thursdayimg+'">')
else if (today==5)
document.write('<img src="'+fridayimg+'">')
else if (today==6)
document.write('<img src="'+saturdayimg+'">')
else
document.write('<img src="'+sundayimg+'">')
//-->
</script>
here's my code for a 7-day change. how would i alter this to increase the days? or if someone could write some new code for daily image changer (up to a month), it would be greatly appreciated. here's my site, if you'd like to take a look. http://fatbottoms.atspace.com
<script>
<!--
var mondayimg="fb124.gif"
var tuesdayimg="fb125.gif"
var wednesdayimg="fb126.gif"
var thursdayimg="fb127.gif"
var fridayimg="fb121.gif"
var saturdayimg="fb122.gif"
var sundayimg="fb123.gif"
var mydate=new Date()
var today=mydate.getDay()
if (today==1)
document.write('<img src="'+mondayimg+'">')
else if (today==2)
document.write('<img src="'+tuesdayimg+'">')
else if (today==3)
document.write('<img src="'+wednesdayimg+'">')
else if (today==4)
document.write('<img src="'+thursdayimg+'">')
else if (today==5)
document.write('<img src="'+fridayimg+'">')
else if (today==6)
document.write('<img src="'+saturdayimg+'">')
else
document.write('<img src="'+sundayimg+'">')
//-->
</script>