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 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
| var sliders = new Class({
Implements: Options,
options : {
//Couleur de l'arriere plan
couleurArrierePlan : 'none',
//Repertoire contenant les images
repertoireImage : './images/',
//Temps chamgement image
tempsSeconde : 1000,
//div emplacement du slider
divEmplacement : 'slideshow',
},
//les variables
images : [],
index: 0,
//Fonction d'initialisation
initialize: function(options, dataImage){
this.setOptions(options);
for(var i = 0; i < dataImage.length; i++)
this.images.push(dataImage[i]);
},
main : function() { //Fonction principale
for(var i = 0; i < this.images.length; i++)
this.images[i] = this.options.repertoireImage + this.images[i];
//Tableau d'images
var loader = new Asset.images(this.images, {
// onComplete: function() {
onComplete: this.complet(),
// this.complet();
// }
});
},
complet: function()
{
var slides = [];
var elemenImage;
for(var i = 0; i < this.images.length; i++)
{
slides.push(
elemenImage = new Element('img', {
id: 'imgSlide'+i,
src: this.images[i],
styles: {
opacity: 0,
position: 'absolute',
'z-index': 10,
},
});
elemenImage.inject($('slideshow-holder-page'), 'bottom');
);
}
/*
// this.images.each(function(im, num) {
// slides.push(new Element('img', {
// src: im,
// styles: {
// opacity: 0,
// position: 'absolute',
// 'z-index': 10
// }
// }).inject(this.options.divEmplacement));
// });
(function() {sliders[index].tween('opacity', 1);}).delay(1000);
var start = function(){(
function()
{
this.options.divEmplacement.setStyle('background', this.options.couleurArrierePlan);
slides[index].fade(0);
++index;
index = (slides[index] ? index : 0);
slides[index].fade(1);
}).periodical(this.options.tempsSeconde);
};
start();
*/
},
}); |