There is an even easier fourth method that would be better for what you are doing because you would want any counter values to remain in the same order. Changing the array wouldn't allow that, and using jumper would mean that the slideshow would have to load first with the 'wrong image' and then switch.
First we edit one line in the swissarmy.js file's inter_slide() function:
Code:
function inter_slide(){
if(!document.images||arguments.length==0)
return;
var imgs=arguments[0];
var width=null, height=null, delay=null;
if(arguments.length==2)
delay=arguments[1];
else if(arguments.length==3||arguments.length==4)
width=arguments[1], height=arguments[2], delay=arguments[3]? arguments[3] : null;
this.dom=(document.getElementById) //modern dom browsers
this.da=document.all
this.delay=imgs.delay? imgs.delay : delay? delay : 3000+iss.length*750;
this.nextimgidx=imgs.nextimgidx? imgs.nextimgidx : 0;
iss[this.issid=iss.length]=this;
this.imgs=imgs;
if (imgs.random)
this.imgs.sort(function() {return 0.5 - Math.ra . . .
Then, on your Swiss Army page we add this code after the array declartion:
Code:
var slides2=[]; //SECOND SLIDESHOW
//configure the below images and descriptions to your own.
slides2[0] = ["../../side/files/photo6.jpg", "Crucifix"];
slides2[1] = ["../../side/files/photo7.jpg", "Alter Boys"];
slides2[2] = ["../../side/files/photo8.jpg", "Young Pan"];
slides2[3] = ["../../side/files/photo9_thumb.jpg", "Mona Lisa"];
//optional properties for these images:
slides2.desc_pref . . .
. . .
slides2.border_color='lightblue'; //set border color for images
;(function(){
var ar = slides2, get = function(n) {
if(!n||typeof n!='string') return null;
var r=new RegExp('[?&;]'+n+'=([^&;#]*)'), m=location.search;
return (m=r.exec(m))? unescape(m[1]) : null;
}
if(get('picnum')&&!isNaN(get('picnum')-0))
ar.nextimgidx = get('picnum')-0;
})();
The red slides2 is the name of the array.
Once you have all that - say your page with Swiss Army on it is called 'swiss.htm', then you may link to it like so:
Code:
<a href="swiss.htm?picnum=1">image tag or link text</a>
The red 1 corresponds to:
Code:
slides2[1] = ["../../side/files/photo7.jpg", "Alter Boys"];
and the slideshow will start with that slide. You can use any number from the array. The show will start with that slide and will still be in order.
Now, if you are using code to open a new window, you can just use the href from the example link as the URL value for the code that opens the new window. From your example and trying to keep to the numbering system you are currently using on your swisstest page (though I'm not wild about everything you are doing to open the new window, or even about opening a new window for this, or about the fact that the numbering order seems counterintuitive):
Code:
<a href="swisstest.htm?picnum=4" onclick="NewWindow(this.href,'imagename','2048','1536','no','');return false" onfocus="this.blur()"><img src="img09.jpg"></a>
Bookmarks