]> www.average.org Git - mkgallery.git/blobdiff - include/show.js
keyboard controls
[mkgallery.git] / include / show.js
index 4bcd28ea0c758aefe48159e620ca23ae239a465f..1a40c569c7ad911bbb4d159e6de28fe7e8f8cd8a 100644 (file)
@@ -62,8 +62,10 @@ var Show = new Class({
                };
                this.updatecoords();
                this.prevdisplay = new Element('img').
+                       setStyle('opacity', 0).
                        injectInside(this.container.container);
                this.ondisplay = new Element('img').
+                       setStyle('opacity', 0).
                        injectInside(this.container.container);
                this.loadingdiv = new Element('div').
                addClass('loading').setStyles({
@@ -94,7 +96,7 @@ var Show = new Class({
                if (this.currentid > 0) {
                        this.show(this.currentid-1);
                } else {
-                       alert('show.prev called beyond first element');
+                       /* alert('show.prev called beyond first element'); */
                }
        },
 
@@ -111,11 +113,16 @@ var Show = new Class({
                this.controls.running(1);
        },
 
+       toggleplay: function(){
+               if (this.isplaying) { this.stop(); }
+               else { this.play(); }
+       },
+
        next: function(){
                if (this.currentid < this.vimgs.length-1) {
                        this.show(this.currentid+1);
                } else {
-                       alert('show.next called beyond last element');
+                       /* alert('show.next called beyond last element'); */
                }
        },
 
@@ -137,6 +144,7 @@ var Show = new Class({
                this.options.cbStart();
                this.isplaying = play;
                this.controls.running(this.isplaying);
+               this.updatecoords();
                this.show(id);
                return false; /* to make it usable from href links */
        },