summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStella Power2008-06-20 15:51:59 (GMT)
committer Stella Power2008-06-20 15:51:59 (GMT)
commit76a30f06f2e4d1b37097ffe3b36adac389139da2 (patch)
treea629085fe7a8f8520171082dd75e728c21d6d8a4
parentaca425b6ef0942b5460c470c34a35ba95ed450d2 (diff)
272458 - fix for overlay not extending to the full width of the window when
horizontally scrolled.
-rw-r--r--js/lightbox.js17
1 files changed, 9 insertions, 8 deletions
diff --git a/js/lightbox.js b/js/lightbox.js
index 92b5dc8..4aa7c77 100644
--- a/js/lightbox.js
+++ b/js/lightbox.js
@@ -683,7 +683,7 @@ var Lightbox = {
if (Lightbox.isZoomedIn && arrayPageSize[1] > arrayPageSize[3]) {
pageHeight = pageHeight + arrayPageScroll[1] + (arrayPageSize[3] / 10);
}
- $('#overlay').css({height: pageHeight + 'px'});
+ $('#overlay').css({height: pageHeight + 'px', width: arrayPageSize[0] + 'px'});
// Gecko browsers (e.g. Firefox, SeaMonkey, etc) don't handle pdfs as
// expected.
@@ -957,14 +957,14 @@ var Lightbox = {
var xScroll, yScroll;
- if (window.innerHeight && window.scrollMaxY) {
- xScroll = window.innerWidth + window.scrollMaxX;
- yScroll = window.innerHeight + window.scrollMaxY;
- }
- else if (document.body.scrollHeight > document.body.offsetHeight) { // all but Explorer Mac
+ 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) {
+ xScroll = window.innerWidth + window.scrollMaxX;
+ yScroll = window.innerHeight + window.scrollMaxY;
+ }
// Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari.
else {
xScroll = document.body.offsetWidth;
@@ -992,6 +992,7 @@ var Lightbox = {
windowHeight = document.body.clientHeight;
}
+
// For small pages with total height less then height of the viewport.
if (yScroll < windowHeight) {
pageHeight = windowHeight;
@@ -1003,10 +1004,10 @@ var Lightbox = {
// For small pages with total width less then width of the viewport.
if (xScroll < windowWidth) {
- pageWidth = xScroll;
+ pageWidth = windowWidth;
}
else {
- pageWidth = windowWidth;
+ pageWidth = xScroll;
}
arrayPageSize = [pageWidth, pageHeight, windowWidth, windowHeight];