Please check the pictures you like to watch and press 'next slide' or 'slide show' or 'tile'
seconds between the slides
slide to goto directly
Auteur:
Jeroen Heemskerk
<!-- This script has been in the http://www.javascripts.com Javascript Public Library! -->
<!-- Note that though this material may have been in a public depository, certain author copyright restrictions may apply. -->
<HTML>
<HEAD><TITLE>Picture slide show</TITLE>
<SCRIPT language="JavaScript">
<!-- Autheur: Jeroen Heemskerk (Bluemoon) --!
var nextslidenr;
var show;
function Nextslide(offset) { // offset = 'goto' or '+nr' or '-nr'
var i,j,start;
i = start = nextslidenr;
if (offset == 'goto') {
i = eval(document.form.directgoto.value)-1;
if ((i < 0) || (i > (document.form.selection.length-1)))
alert("The number must be between 1 and "+document.form.selection.length+"!");
else nextslidenr = i;
} else {
for(j=0;j<offset[1.];j++) {
while ((i<document.form.selection.length)&&(i>=0)&&(nextslidenr == start)) {
if (document.form.selection[i].checked) nextslidenr = i;
i += eval('0'+offset[0]+'1');
}
// not found? maybe before the slide were showing?
if (offset[0]=="-") i=document.form.selection.length-1; else i=0;
while ((nextslidenr == start) && (((i<start)&&(offset[0]=="+")) || ((i>start)&&(offset[0]=="-")))) {
if (document.form.selection[i].checked) nextslidenr = i;
i += eval('0'+offset[0]+'1');
}
i = start = nextslidenr;
}
}
// show the slide
document.slideshow.src = document.form.selection[nextslidenr].value;
if (show==1) id=setTimeout("Nextslide('"+offset+"')",
eval(document.form.timeframe.value)*1000+1);
// 2000 = 2 seconds
}
function tile() {
var i,count, w,h, max_next_to_eachother;
var pic = new Array;
count=0;
max_next_to_each_other = 2;
// which pictures are selected?
for(i=0;i<document.form.selection.length;i++)
if (document.form.selection[i].checked) {
pic[count]= new Image;
pic[count].src=document.form.selection[i].value;
count++;
}
// calculate width and height
if(eval(pic.length/max_next_to_each_other)>=1) {
w = 550 / max_next_to_each_other;
h = 400 / (parseInt(""+(pic.length/max_next_to_each_other))+1); }
else { w = 550 / pic.length;
h = 400; }
// make tile window
tilewindow = window.open("","twin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,width=605,height=460");
tilewindow.document.write("<HTML><HEAD><TITLE>tile'd</TITLE></HEAD><BODY>");
for(i=0;i<count;i++) {
tilewindow.document.write("<IMG SRC='"+pic[i].src+"' height="+h+" width="+w+">");
if ((eval(i%max_next_to_each_other)==0)&&(i>0)) tilewindow.document.write("<BR>"); }
tilewindow.document.write("<BR><FORM><INPUT type=button value=close Onclick='self.close()'></FORM></BODY></HTML>");
}
<!-- --></SCRIPT></HEAD>
<BODY Onload="javascript:nextslidenr=document.form.selection.length-1;show=0">
Please check the pictures you like to watch and press 'next slide' or 'slide show' or 'tile'
<FORM name=form>
<INPUT type=checkbox name=selection value="5.gif" checked><img src="5.gif"><BR>
<INPUT type=checkbox name=selection value="6.gif" checked><img src="6.gif"><BR>
<INPUT type=checkbox name=selection value="7.gif" checked><img src="7.gif"><BR><BR>
<INPUT type=button OnClick="tile()" value = " Tile "><BR>
<!-- the picture where the show must go on -->
<IMG name="slideshow" src="7.gif" width=100 height=100><BR>
<!-- the buttons for the control -->
<INPUT type=button OnCLick="show=1;Nextslide('-1')" value="slide show backward">
<INPUT type=button Onclick="show=0" value="Stop">
<INPUT type=button OnCLick="show=1;Nextslide('+1')" value="slide show forward"><BR>
<INPUT type=button OnCLick="Nextslide('-2')" value="second Previous slide">
<INPUT type=button OnCLick="Nextslide('-1')" value="Previous slide">
<INPUT type=button OnCLick="Nextslide('+1')" value="Next slide">
<INPUT type=button OnCLick="Nextslide('+2')" value="Second Next slide"><BR>
<INPUT type=text Value=2 name="timeframe" size=4> seconds between the slides<BR>
<INPUT type=text value=1 name="directgoto" size=4 onChange="Nextslide('goto')" OnSubmit="Nextslide('goto')"> slide to goto directly
</FORM><BR>
Auteur: <A href="mailto:jeroen.heemskerk@technologist.com">Jeroen Heemskerk</A>
</BODY>
</HTML>