]> www.average.org Git - mkgallery.git/blobdiff - include/showwin.js
hide scroll bars when going to show mode; some rearrangement
[mkgallery.git] / include / showwin.js
index 3fac7f6b7de60a29bccb29fa38516cc41447cf0e..c900ab4decbd10e92094e6e57f4f7aee04561e3f 100644 (file)
@@ -68,15 +68,29 @@ var showWindow = new Class({
 
        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');
        }
 })