Well, I realized this wasn't optimal. Then I got to thinking, if I can rearrange the array I ought to be able to put it in any order I like and make adjustments for the image 1 of 22 thing. It turns out to be like I said, a minor modification but, I had all I really needed, just about, from the previous modification. So, start over, remove all that added stuff, add this instead (the get function is the same though):
Code:
function get(key_str) {
var query = window.location.search.substr(1);
var pairs = query.split("&");
for(var i = 0; i < pairs.length; i++) {
var pair = pairs[i].split("=");
if(unescape(pair[0]) == key_str)
return unescape(pair[1]);
}
return null;
}
(function(an, num){
if(an.splice&&num==num&&num){
an.tmp=an.splice(num,an.length-1*num);
an.tmp2=an.splice(0,an.length);
an.splice(0,1,an.tmp[0]);
for (var i_tem = 1; i_tem < an.tmp.length; i_tem++)
an.push(an.tmp[i_tem]);
for (var i_tem = 0; i_tem < an.tmp2.length; i_tem++)
an.push(an.tmp2[i_tem]);
an.countf=num;
}
})(array_name, 1*get('picnum'));
Now there is only one place to put the name of your array, replace array_name with it. We also need a modification to swissarmy.js - fairly near the end of the file you will find:
inter_slide.prototype.rotateimg=function()
it contains, near its end, these lines:
Code:
if(this.counter){
var padit='';
for (var p=0; p<this.cpad-(this.nextimgidx+1).toString().length; p++)
padit+='<span style="visibility:hidden;">0</span>';
this.go('thecnt'+this.issid).innerHTML = padit+(this.keeptrack()<this.imgs.length? this.keeptrack()+1 : 1);
}
Replace them with:
Code:
if(this.counter){
var padit='';
for (var p=0; p<this.cpad-(this.nextimgidx+1).toString().length; p++)
padit+='<span style="visibility:hidden;">0</span>';
this.countf=this.imgs.countf||0;
this.go('thecnt'+this.issid).innerHTML = padit+(this.keeptrack()+this.countf<this.imgs.length? this.keeptrack()+this.countf+1 : this.keeptrack()+this.countf+1-this.imgs.length);
}
That will get the counter reporting the correct number. Your last question (the 'one last question'), retrieving the image number with a function was easy but now, with these modifications, It is a little more complicated, I will make that up and post it next in this thread.
Bookmarks