- var newstyle = this.calcsize(cachel);
- var newimg = cachel.img.clone();
- newimg.setStyles(newstyle);
- newimg.replaces(this.ondisplay);
- this.ondisplay = newimg;
+ var newimg = cachel.img.clone().
+ set('class', 'mainformat').
+ setProperty('alt', 'Current Image').
+ setStyles(this.calcsize(cachel)).
+ setStyles({
+ zIndex: 3,
+ opacity: 0,
+ });
+ this.ondisplay.replaces(this.prevdisplay).
+ setProperty('alt', 'Previous Image').
+ setStyle('zIndex', 2);
+ this.prevdisplay = this.ondisplay;
+ this.ondisplay = newimg.
+ injectInside(this.container.domelement());
+ 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');