In a continuation from my previous post I’m still trying to find a good solution for a rotating header. I wanted to stay away from flash. Partly because I’m not very familiar with flash & I wanted to be a little more universally compatible. I’ve tried an animated .gif, which works, but its 800K! Not very dial-up compatible. Even lags a sec on my high-speed.
Sadly, if you’re looking at 800kB in pictures like that, the solution is simple: don’t.
That said, for things like this, I’ve seen flash (sorry) do simply *amazing* things that I couldn’t dream of doing otherwise. This is mostly in terms of file size and animation. I don’t know the specifics, but for something that’s going to be 800kB in raw pictures, flash WILL save you a LOT of bandwidth (if you do it right). Several hundred kB (likely well over 650-700), unless you’ve got things like motion video going on.
Universal compat. with flash? Good question. The site is obviously biased a bit, but they can only fake their figures so much: http://www.macromedia.com/software/player_census/flashplayer/
(I can’t believe I just recommended flash for something… though in all honesty, I wouldn’t be doing stuff like that in the first place, so whatever :))
As far as bandwidth, however, constantly pulling images may infact increase your bandwidth in the long term, then a single 800KB image that is only called once. I guess you would have to decide what is more important. Your bandwidth, or the load time of the user.
var thedate=new Date(); //get the date from the computer
var nday=thedate.getDate(); //extract the day (0-6) from the date
var str=’image’+nday+’.jpg’; //create the image file name: ‘imageX.jpg’, where X is the day
document.images[‘image’].src=str; //assign the image file name
You will also need to add the following to the body:
This allows for a daily changing of your banner or image. All you need to store all your images in the same folder as your page. You also need to name each image as follows: image1, image2, image3 etc.