X-Git-Url: http://www.average.org/gitweb/?p=mkgallery.git;a=blobdiff_plain;f=include%2Fshow.js;fp=include%2Fshow.js;h=39059182c05861c95a48756c1cdb71aab24db12b;hp=b9ee1a08d8ef154c1ff26971db1acb92f7744968;hb=78362df33eae45686a72edd0f13f060aad6c136b;hpb=741d62b401cb7cf4b36f733c19af7b45ba51b1a8 diff --git a/include/show.js b/include/show.js index b9ee1a0..3905918 100644 --- a/include/show.js +++ b/include/show.js @@ -72,8 +72,6 @@ var Show = new Class({ this.updatecoords(); this.prevdisplay = new Element('img'). - set('class', 'mainformat'). - setProperty('alt', 'Current Image'). setStyle('opacity', 0). injectInside(this.container.domelement()); this.ondisplay = this.prevdisplay.clone(). @@ -242,18 +240,20 @@ var Show = new Class({ }, display: function(cachel){ - var newstyle = this.calcsize(cachel); - var newimg = cachel.img.clone(); - newimg.setStyles(newstyle); - newimg.setStyles({ + var newimg = cachel.img.clone(). + set('class', 'mainformat'). + setProperty('alt', 'Current Image'). + setStyles(this.calcsize(cachel)). + setStyles({ zIndex: 3, opacity: 0, }); - this.prevdisplay.dispose(); - this.prevdisplay = this.ondisplay.clone(). - setStyle('zIndex', 2).injectInside(this.container.domelement()); - newimg.replaces(this.ondisplay); - this.ondisplay = newimg; + 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(); },