1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
| var totimages = 100;
var images=new Array();
for (id = 1; id <= totimages; id++) {
images[id]="mainpics/apn/apn_" + id + ".jpg";
}
var max_xd = 10;
var temp=new Array();
var maliste = "";
var xd = 1;
var found = false;
while (xd <= max_xd) {
var choix = Math.floor(Math.random()*totimages+1);
temp[xd] = choix;
if (xd > 1) {
found = false;
for (var y = 1; y <= xd-1; y++)
{
if (temp[y]==choix) {
found = true;
}
}
}
if (found == false) {
xd++;
if (xd < max_xd+1) {
maliste = maliste + '["' + images[choix] + '"],\n';
}
else {
maliste = maliste + '["' + images[choix] + '"]';
}
}
}
//alert(maliste); //pour verification string finale en mode debug
{
var mygallery=new fadeSlideShow({
wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
dimensions: [360, 240], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
maliste
],
//["mainpics/apn1/apn_1.jpg"],
//["mainpics/apn1/apn_2.jpg"],
//["mainpics/apn1/apn_30.jpg"]
//],
displaymode: {type:'auto', pause:5000, cycles:0, wraparound:false, randomize:true}, //pause:1000
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 3000, //transition duration (milliseconds) //fadeduration: 1000
descreveal: "ondemand",
togglerid: ""
})
} |
Partager