Let's say I have a banner on my site that randomly rotates between images that depict the month of January. Is it possible to have 10 images randomly rotate the entire month, then to have a new 10 images rotate randomly for the following month? I also need each image to link to its link.
I was thinking an If/Then statement might work, but I have no clue... and frankly, I'm not a very good coder.
IF MONTH=January, then show this
<center><script language="JavaScript">
<!--
function random_imglink(){
var myimages=new Array()
//specify random images below. You can have as many as you wish
myimages[1]="https://dl.dropboxusercontent.com/u/snowman.png"
myimages[2]="https://dl.dropboxusercontent.com/u/newyears.png"
myimages[3]="https://dl.dropboxusercontent.com/u/mlk.png"
myimages[4]="https://dl.dropboxusercontent.com/u/january.png"
myimages[5]="https://dl.dropboxusercontent.com/u/winter.png"
myimages[6]="https://dl.dropboxusercontent.com/u/sled.png"
myimages[7]="https://dl.dropboxusercontent.com/u/fireworks.png"
myimages[8]="https://dl.dropboxusercontent.com/u/celebration.png"
myimages[9]="https://dl.dropboxusercontent.com/u/jan2.png"
myimages[10]="https://dl.dropboxusercontent.com/u/jan3.png"
//specify corresponding links below
var imagelinks=new Array()
imagelinks[1]="http://mysite.com/snowparty"
imagelinks[2]="http://mysite.com/sledrentals"
imagelinks[3]="http://mysite.com/civilrights"
imagelinks[4]="http://mysite.com/januarycalendar"
imagelinks[5]="http://mysite.com/schoolsched"
imagelinks[6]="http://mysite.com/sledrentals"
imagelinks[7]="http://mysite.com/fireworks"
imagelinks[8]="http://mysite.com/wine"
imagelinks[9]="http://mysite.com/januarycalendar"
imagelinks[10]="http://mysite.com/januarycalendar2"
var ry=Math.floor(Math.random()*myimages.length)
if (ry==0)
ry=1
document.write('<a href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" style="border:4px #660000 solid;"></a>')
}
random_imglink()
//-->
</script></center>
IF MONTH=February, then show this
<center><script language="JavaScript">
<!--
function random_imglink(){
var myimages=new Array()
//specify random images below. You can have as many as you wish
myimages[1]="https://dl.dropboxusercontent.com/u/valentines.png"
myimages[2]="https://dl.dropboxusercontent.com/u/presidents.png"
myimages[3]="https://dl.dropboxusercontent.com/u/groundhog.png"
myimages[4]="https://dl.dropboxusercontent.com/u/february.png"
myimages[5]="https://dl.dropboxusercontent.com/u/lincoln.png"
myimages[6]="https://dl.dropboxusercontent.com/u/washington.png"
myimages[7]="https://dl.dropboxusercontent.com/u/spring.png"
myimages[8]="https://dl.dropboxusercontent.com/u/blackhistory.png"
myimages[9]="https://dl.dropboxusercontent.com/u/feb2.png"
myimages[10]="https://dl.dropboxusercontent.com/u/feb3.png"
//specify corresponding links below
var imagelinks=new Array()
imagelinks[1]="http://mysite.com/hearts"
imagelinks[2]="http://mysite.com/prez"
imagelinks[3]="http://mysite.com/billmurray"
imagelinks[4]="http://mysite.com/febcalendar"
imagelinks[5]="http://mysite.com/tallmen"
imagelinks[6]="http://mysite.com/president1"
imagelinks[7]="http://mysite.com/equinox"
imagelinks[8]="http://mysite.com/africa"
imagelinks[9]="http://mysite.com/febcalendar"
imagelinks[10]="http://mysite.com/febcalendar2"
var ry=Math.floor(Math.random()*myimages.length)
if (ry==0)
ry=1
document.write('<a href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" style="border:4px #660000 solid;"></a>')
}
random_imglink()
//-->
</script></center>