Javascript slideshow

In another thread we were discussing wallpaper and I mentioned I do not like it because it clutters the desktop and you cannot see the picture well anyway (not to mention it uses resources I can use better for whatever I am usng the computer for).

But, I do have a folder with hundreds of nice photos which I like to look at and I’d like to do a slide show which would display them in order or maybe in random order.

I have a program called AIpict (http://members.aol.com/aipict/) which is not very good but will do a slide show if you give it a text file with all the file names. It is not very practical.

I also have MS Photo Editor 3.0 but I believe it has no slideshow capability.

Finally I have MS Internet Explorer 5.0 and I was thinking it would probably be relatively easy for someone with knowledge of Javascript to program this as an HTML file. Just have the page refresh every x seconds and display a different file (can this be done?).

I also remember that you can start MSIE with a switch so that it will take the entire screen, no toolbar or anything, 100% displayed photo.

I would prefer it would display the photos randomly because if not you just get to see the ones at the biginning all the time and not the rest.

If this is difficult or impossible maybe it could just display them in order BUT start at a random place down the list.

Can someone help? Any ideas?

Well, I don’t personally know how to do it, but the physics department has something similar on some of their pages. You can check it out, for instance, at http://www.lmsal.com/SXT/movies_archive/June_1998_small_fov_revct_j.html
This is set up as a movie, but you can change the delay between frames to something that would be more of a slide show.

Chronos, thanks for that link. I see it is done to simulate a movie (of an out of focus egg being fried??) and I looked at the source coding but it would not quite work for what I want. The main problem is you have to list in the source code every file to be displayed. What I want is a program that you can give it a folder path and will display all the files in that folder without need to name them individually.

I am also trying to remember out of curiosity what switch makes Internet Explorer take up the entire screen.

Well, a million Kelvins would, admittedly, fry an egg pretty quickly, but those are pictures of a portion of the Sun in soft X-rays, showing what’s called a sigmoid, or s-shaped feature, which often leads to an eruption. Sorry I couldn’t be more help…

There’s also screensavers that you can get that’ll do exactly what you’re looking for, no Java required, but they’re hideously overpriced, for all the more involved they are.

Sailor, I use a fantastic little graphics viewer called IrfanView, which is availalble FREE as a download from http://www.irfanview.com.

Not only will IrfanView do slideshows, it will also conert between a number of formats, and has some image manipulation tools as well. Creating new desktop wallpaper is a matter of one muose click. The best thing about Irfan View (apart from it being FREEWARE) is that it is less than 600k in size, intergrates seamlessly with Windows Explorer,and it just drops into a directory without the need for a complicated installation. Most multimedia formats are supported, although some may require a plug-in (available at the same site) to work properly.

Hope you find it useful too.

Dvous, that link didn’t work but I found it at http://members.home.com/rsimmons/irfanview/english.htm

It turns out I must have had that program in the past because I immediately recognized the icon. I recall vaguely having it long time ago but it seems it has been improved. I probably lost it in one of my many reinstallations. Anyway, I have done an initial test and it pretty much does what I want. Thanks.

I use ACDSee. It has a pretty good slide show feature. It’s the best graphics viewer I’ve come across in general, really.

Glad you liked it sailor.

Sorry about the bad link. Here is the correct one for the official Irfan View site:

http://stud1.tuwien.ac.at/~e9227474/english.htm

The latest version is 3.21, in case what you have is not quite up to date. Be sure to get the plug-ins for multimedia support, so you can play MPEG movies, MP3’s etc.

I don’t know if this is exactly what you’re looking for, but with a few changes I think it could do what you want.

Anyway, in order for this javascript to work you need to be using Netscape Navigator 4+ (the layer object doesn’t work in IE, I don’t think…this is the only way I was able to change the background image after the page was loaded)

There is an extra text box that’s in there, just to show you that the timer is actually running…you can take that out pretty easily. Just type the file’s pathname into the second text box, and that will load the new image after a minute. (I’m sure you could remove that entirely, and just type in a bunch of file paths within the function itself)


<HTML>
<HEAD>
<TITLE>Changing backgrounds</TITLE>
<SCRIPT LANGUAGE=“JavaScript”>
<!–
var running = false
var endTime = null
var timerID = null

function startTimer(){
running = true
now = new Date()
now = now.getTime()
//change the last number for the number of minutes >>
endTime = now + (1000 * 60 * 1)
showCountDown()
}

function setBG(URL){
document.tester.background.src = URL
}

function showCountDown(){
var now = new Date()
now = now.getTime()
if (endTime - now <= 0) {
stopTimer()
alert(“Time is up.”)
setBG(document.forms[0].urlNAME.value)
}
else {
var delta = new Date(endTime - now)
var theMin = delta.getMinutes()
var theSec = delta.getSeconds()
var theTime = theMin
theTime += ((theSec < 10) ? “:0” : “:”) + theSec
document.forms[0].timerDisplay.value = theTime
if(running) {
timerID = setTimeout(“showCountDown()”,1000)
}
}
}

function stopTimer(){
clearTimeout(timerID)
running = false
document.forms[0].timerDisplay.value = “0:00”
}

//–>
</SCRIPT>
</HEAD>

<BODY>
<LAYER NAME=“tester” TOP =50 HEIGHT = 400>
<FORM>
<INPUT TYPE=“button” NAME=“startTime” VALUE=“Start 1 min. Timer” onClick=“startTimer()”>
<INPUT TYPE=“button” NAME=“clearTime” VALUE=“Clear Timer” onClick=“stopTimer()”><P>
<INPUT TYPE=“text” NAME=“timerDisplay” VALUE="">
<INPUT TYPE=“text” NAME=“urlNAME” VALUE="">
</FORM>
</LAYER>
</BODY>


As for opening a page in IE without a toolbar, using javascript just type:

window.open(“http://straightdope.com”,"",“toolbar=0”)

DVous, the version I got is Irfan 3.25 and it does everything but I only want it for slideshows, not video. The only thing I wish it did would be a slideshow in a window but it takes up the entire screen for the slideshow. I swish I got an option.

Starbury, thanks for that javascript code and I’ll look into it and tinker. I like to mess with these things.

There is a switch -k that will launch IE in kiosk (full window) mode:
“C:\Program Files\Internet Explorer\IEXPLORE.EXE” -k “C:\My Images\photo1.jpg”

It is explained here http://www.kiosks.org/articles/kioskmode.htm

I think it should not be difficult to write a Javascript that would change the image every few seconds… i might try it

Aglarond, thanks for the lead. I’ll look into it when I have time.

I’ve seen quite a few “random image” scripts out there that you could use with the refresh tag. Problem is, you have to enter filenames into the script manually, which is seems to be the major pain the ass that you were describing for your other program.

I highly recommend Thumbs Plus http://thumbsplus.com . You can get thumbnail views of all the images in a directory, slide shows, and it will do a batch conversion of all the images you ask it to into thumbnails as well as coding the html for a table-based thumbnail gallery. Pretty slick.

I think it only supports jpgs, tho.

sailor, I use VuePrint, which does it all, in other words, I can just select OPEN, enter the directory & it opens all graphic files there by itself, also does slide shows & thumbnails,…pretty small program too.

You can get it from download.com as well as many programs that do slide shows if you search for ‘slide shows’.

Thanks to all, you have given me enough information to keep me busy for a while.