Hello,
As it is mentionned in this issue https://support.microsoft.com/en-us/kb/2684777, the scrollHeight property of an iframe may return a value smaller than expected.
This cause a problem in lightbox.js plugin while trying to calculate the overlay height after zooming in an image which has a big height (~4500px).
His is the code that use scrollHeight:
getPageSize : function() {
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.
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;
}
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.
windowWidth = document.body.clientWidth;
windowHeight = document.body.clientHeight;
}
// For small pages with total height less than height of the viewport.
if (yScroll < windowHeight) {
pageHeight = windowHeight;
}
else {
pageHeight = yScroll;
}
// For small pages with total width less than width of the viewport.
if (xScroll < windowWidth) {
pageWidth = xScroll;
}
else {
pageWidth = windowWidth;
}
arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
return arrayPageSize;
},
Thanks,
Comment | File | Size | Author |
---|---|---|---|
#2 | lightbox2-ScrollheightIESupport-26797789-#2-d7.patch | 625 bytes | Mouna Hammami |
Comments
Comment #2
Mouna Hammami CreditAttribution: Mouna Hammami commentedHi,
This patch can solve this issue.
it works for D7 version.
Comment #3
joseph.olstadHi Mouna, thanks for the patch, which version of Internet Explorer should I test this patch on?
Comment #4
joseph.olstadComment #5
Mouna Hammami CreditAttribution: Mouna Hammami commentedhi joseph,
I had this issue when i worked with IE11.
Comment #6
joseph.olstadComment #7
joseph.olstadComment #8
pifagor+1
Comment #10
volegerThanks, fixed.