Randomize my blogspot logobar!
May 12, 2004 3:48 PM   Subscribe

I have a logobar on my blogspot hosted weblog of a predetermined size. I'm quite bored with just having the same one pop up all the time so I'm wondering how easy it would be to load up a new bar randomly from a predetemined directory on another server (ie, the free space I have with my ISP where the currect static bar is located) each time the page is accessed ala hotornot.
posted by feelinglistless to Computers & Internet (3 answers total)
 
You could do this quite easily with a javascript, or with a php script like Automatic's Rotator (if your ISP allows you to use php). With a javascript it would just be a matter of adding a couple of lines to your Blogger template, mostly just a cut and paste operation. Enjoy!
posted by bcwinters at 4:47 PM on May 12, 2004


Below is one that I made, feel free to use it. You just need to change the ImagePath and ImageArray variable to point to the base path where your images will be, and to each paticular image file name. The Link array lets you change the link that each image goes to as well.



var ImagePath = new String("img_swap/");
var ImageArray = new Array("swap_advan.gif", "swap_phoenix.gif");
var LinkPath = new String("");
var LinkArray = new Array( "", "prod_phoenix.html", "")
var RandIndex = Math.round(Math.random() * (ImageArray.length - 1));
var NewImagePath = ImagePath + ImageArray[RandIndex];
document.images["header_left"].src = NewImagePath;
var NewLinkPath = LinkPath + LinkArray[RandIndex];
document.links[0].href = NewLinkPath;

posted by skwm at 5:31 PM on May 12, 2004


I have used Rotator a couple of times and it is excellent, mainly because you can very easily add and subtract images from the bucket by adding or removing them from the directory without having to alter the script every time.
posted by dg at 11:40 PM on May 12, 2004


« Older Help Me Understand How Rectangles or Toilets Are...   |   Mail delivery failure messages for email I've... Newer »
This thread is closed to new comments.