]> www.average.org Git - mkgallery.git/blobdiff - include/showwin.js
display & slideshow work, FX not implemented
[mkgallery.git] / include / showwin.js
index 3fac7f6b7de60a29bccb29fa38516cc41447cf0e..96568269b88b35f44adffbc9ba751442c16b8cf0 100644 (file)
@@ -53,10 +53,12 @@ var showWindow = new Class({
 
        position: function(){
                if(this.options.container == document.body){
+                       this.w = window.getWidth();
                        this.h = window.getHeight();
                        this.s = window.getScrollTop();
                }else{
                        var myCoords = this.options.container.getCoordinates();
+                       this.w = myCoords.width;
                        this.h = myCoords.height;
                        this.s = myCoords.top;
                }
@@ -66,17 +68,39 @@ var showWindow = new Class({
                })
        },
 
+       getCoordinates: function(){
+               return {
+                       width: this.w,
+                       height: this.h,
+                       top: this.s,
+               };
+       },
+
        show: function(){
                if (this.options.tohide) {
-                       this.options.tohide.setStyle('display', 'none');
+                       this.hiddenstyles = this.options.tohide.getStyles(
+                               'display'
+                       );
+                       this.options.tohide.setStyles({
+                               display: 'none',
+                       });
                }
+               this.bodystyles = document.body.getStyles(
+                       'overflow', 'overflow-x', 'overflow-y'
+               );
+               document.body.setStyles({
+                       overflow: 'hidden',
+                       'overflow-x': 'hidden',
+                       'overflow-y': 'hidden',
+               });
                this.container.setStyle('display', 'block');
        },
 
        hide: function(){
                if (this.options.tohide) {
-                       this.options.tohide.setStyle('display', 'block');
+                       this.options.tohide.setStyles(this.hiddenstyles);
                }
+               document.body.setStyles(this.bodystyles);
                this.container.setStyle('display', 'none');
        }
 })