#3046 closed bug (duplicate)
$(window).height() returns wrong value in Opera 9.5
Reported by: | Melmac | Owned by: | brandon |
---|---|---|---|
Priority: | major | Milestone: | 1.3 |
Component: | dimensions | Version: | 1.2.6 |
Keywords: | Opera 9.5 window height | Cc: | |
Blocked by: | Blocking: |
Description
$(window).height() returns wrong value in Opera 9.5. This might be more Opera's problem since this works fine in Opera 9.27
Attachments (2)
Change History (8)
comment:1 Changed 15 years ago by
comment:2 Changed 15 years ago by
Okey, I figured out how to fix it. In JQuery 1.2.6 line 1342
jQuery.browser.opera && document.body[ "client" + name ] ||
change it to
jQuery.browser.opera && jQuery.browser.version < 9.50 && document.body[ "client" + name ] ||
Now it works in Opera 9.27 and 9.50 (amongst others).
comment:3 Changed 15 years ago by
Temporary solution.
jQuery.fn.height_opera95_fixed = function() { if ( this[0] == window && jQuery.browser.opera && jQuery.browser.version >= 9.50) return window.innerHeight; else return $(this[0]).height(); };
Replace $(window).height() with $(window).height_opera95_fixed()
comment:4 Changed 15 years ago by
I think a better temporary solution probably is:
var height_ = jQuery.fn.height; jQuery.fn.height = function() { if ( this[0] == window && jQuery.browser.opera && jQuery.browser.version >= 9.50) return window.innerHeight; else return height_.apply($(this[0])); };
comment:5 Changed 14 years ago by
ugh, that last line should be
else return height_.apply(this,arguments);
Note: See
TracTickets for help on using
tickets.
Is there any nice way to replace $(window).height() -function?
Something like this:
But this obviously doesn't work.