Fix Opera 9.5 strict issue that swaps documentElement.clientHeight with body.clientHeight.

This commit is contained in:
Andrew Dupont 2008-05-20 14:37:23 -05:00 committed by Tobie Langel
parent 67107651c2
commit 34798f0d74
1 changed files with 2 additions and 3 deletions

View File

@ -1176,12 +1176,11 @@ Element.addMethods = function(methods) {
document.viewport = {
getDimensions: function() {
var dimensions = { };
var B = Prototype.Browser;
var dimensions = { }, B = Prototype.Browser;
$w('width height').each(function(d) {
var D = d.capitalize();
dimensions[d] = (B.WebKit && !document.evaluate) ? self['inner' + D] :
(B.Opera) ? document.body['client' + D] : document.documentElement['client' + D];
(B.Opera && opera.version() < 9.5) ? document.body['client' + D] : document.documentElement['client' + D];
});
return dimensions;
},