cbExit: function(){ alert('show exit undefined'); },
percentage: 98,
delay: 5000,
+ fxduration: 200,
}
},
next: {},
};
this.updatecoords();
- this.previd = -1;
+ this.prevdisplay = new Element('img').
+ injectInside(this.container.container);
this.ondisplay = new Element('img').
injectInside(this.container.container);
this.loadingdiv = new Element('div').
position: 'absolute',
top: 0,
left: 0,
- zIndex: 3,
+ zIndex: 4,
display: 'none',
width: this.coords.width,
height: this.coords.height,
exit: function(){
if (this.isplaying) { $clear(this.timer); }
+ this.prevdisplay.setStyle('display', 'none');
+ this.ondisplay.setStyle('display', 'none');
this.stopfx();
this.options.cbExit();
},
show: function(id){
/* alert('called show.show('+id+')'); */
- this.previd = this.currentid;
this.currentid = id;
var newcache = {
prev: (id > 0)?this.prepare(id-1):{},
var newstyle = this.calcsize(cachel);
var newimg = cachel.img.clone();
newimg.setStyles(newstyle);
+ newimg.setStyles({
+ zIndex: 3,
+ opacity: 0,
+ });
+ this.prevdisplay.dispose();
+ this.prevdisplay = this.ondisplay.clone().
+ setStyle('zIndex', 2).injectInside(this.container.container);
newimg.replaces(this.ondisplay);
this.ondisplay = newimg;
+ this.effect();
+ },
+
+ effect: function(){
+ this.fx = new Fx.Tween(this.ondisplay, {
+ duration: this.options.fxduration,
+ });
+ this.fx.addEvent('complete',this.displaycomplete.bind(this));
+ this.fx.start('opacity', 0, 1);
+ },
+
+ displaycomplete: function(){
+ this.prevdisplay.setStyle('display', 'none');
if (this.isplaying) {
this.timer = this.autonext.delay(this.delay,this);
}
},
stopfx: function(){
+ if (this.fx) this.fx.cancel();
},
updatecoords: function(){