View Full Version : Please suggest a script to allow the display of variable images

01-26-2012, 05:58 PM
I'd like to frequently vary the image displayed on a page when it is loaded - to freshen up the page. Is the best way to simply use a slide show script (such as the Swiss Army Image Slideshow - http://www.dynamicdrive.com/dynamicindex14/swissarmy/index.htm) with the time between image changes set to a very high value and image sequence set to random? Or is there a better way?
Thanks in anticiaption,

01-26-2012, 06:07 PM
That's a pretty good way. Or you could set it to manual (manual_start=1) and give no controls (no_controls=1).

You could have a simple random image script, but the difference in the amount of code involved is negligible when compared to the amount of bytes an image requires. So Why bother reinventing the wheel?

Plus, with Swiss Army you get your images cached sooner. That has trade offs, but generally is a good thing.

01-28-2012, 12:22 PM
Hi John,
That works well, thanks. One minor point of clarification, though. Is it possible to suppress all spacing after the image(s). I've set the 'no additional spacing' parameter to 1, but still get a single line of spacing. Can this, too, be supressed?

01-28-2012, 03:53 PM
That's actually:


Make sure you're using that, and one to add if you're not using descriptions is:


But I was just testing all that, and one <br> tag was still creeping in.

Getting rid of it is pretty easy, just make a container div if you don't have one already. Like where you have something like so in the body where the image appears:

<script type="text/javascript">
new inter_slide(slides)

Make that:

<div id="randomimage">
<script type="text/javascript">
new inter_slide(slides2)

Then put this stylesheet in the head of the page:

<style type="text/css">
#randomimage br {
display: none;

Or add its rule to an existing stylesheet for the page.

If you want more help, please post a link to the page on your site that contains the problematic code so we can check it out.

01-28-2012, 06:29 PM
Thanks John, I'll try what you suggest.

01-29-2012, 09:06 AM
Thanks John. That works fine. Andy