Index: js/lightbox.js =================================================================== --- js/lightbox.js (revision 27) +++ js/lightbox.js (working copy) @@ -924,64 +924,52 @@ // Returns array with page width, height and window width, height. // Core code from - quirksmode.com. // Edit for Firefox by pHaez. + getPageSize : function() { var xScroll, yScroll; - - if (document.body.scrollHeight > document.body.offsetHeight) { // all but Explorer Mac - xScroll = document.body.scrollWidth; - yScroll = document.body.scrollHeight; - } - else if (window.innerHeight && window.scrollMaxY) { + + if (window.innerHeight && window.scrollMaxY) { xScroll = window.innerWidth + window.scrollMaxX; yScroll = window.innerHeight + window.scrollMaxY; - } - // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari. - else { + } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac + xScroll = document.body.scrollWidth; + yScroll = document.body.scrollHeight; + } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari xScroll = document.body.offsetWidth; yScroll = document.body.offsetHeight; } - + var windowWidth, windowHeight; - - if (self.innerHeight) { // All except Explorer. - if (document.documentElement.clientWidth) { - windowWidth = document.documentElement.clientWidth; - } - else { - windowWidth = self.innerWidth; - } - windowHeight = self.innerHeight; + + if (self.innerHeight) { // all except Explorer + + if(document.documentElement.clientWidth){ + windowWidth = document.documentElement.clientWidth; + } else { + windowWidth = self.innerWidth; } - // Explorer 6 Strict Mode. - else if (document.documentElement && document.documentElement.clientHeight) { + windowHeight = self.innerHeight; + } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; - } - else if (document.body) { // Other Explorers. + } else if (document.body) { // other Explorers windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; - } - - - // For small pages with total height less then height of the viewport. - if (yScroll < windowHeight) { + } + // for small pages with total height less then height of the viewport + if(yScroll < windowHeight){ pageHeight = windowHeight; - } - else { + } else { pageHeight = yScroll; } - - - // For small pages with total width less then width of the viewport. - if (xScroll < windowWidth) { + // for small pages with total width less then width of the viewport + if(xScroll < windowWidth){ + pageWidth = xScroll; + } else { pageWidth = windowWidth; } - else { - pageWidth = xScroll; - } - - arrayPageSize = [pageWidth, pageHeight, windowWidth, windowHeight]; + arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight); return arrayPageSize; },