Posts Tagged ‘image’

“Randomize” Header Images

Tuesday, February 21st, 2006

When I was developing FSA Tech Team website, I made random image rotator. Whenever the page is being refreshed, a new picture comes randomly from the album which belongs to. Since the website is static, I used JavaScript to develop it. The principal is simple: All picture files name are a number like 1.jpg, 2.jpg, 3.jpg so on. Create album folders like album1, album2, and son on. Inside those album folders, create a tn album for thumbnails. Then produce a random number - Math.random() - upto the number of files and by using this number, call the picture - document.write - . It is simple but nice! Isn’t it? ;)

(more…)