jQuery: Window height given wrong value in Opera

After some messing around with jQuery, Opera and CSS, I figured it wasn't my fault the element wasn't being centered in the middle of the screen.

The reason being that as of Opera 9.5, they relocated the body height of the document to another place, so jQuery retrieves the wrong size when you call $(window).height().

A simple one line fix would to retrieve the correct height would be:

// fix a jQuery/Opera bug with determining the window height
var h = $.browser.opera && $.browser.version > "9.5" &&
$.fn.jquery <= "1.2.6" ?
document.documentElement["clientHeight"] :

[ Source ]

Copyright © Twig's Tech Tips
Theme by BloggerThemes & TopWPThemes Sponsored by iBlogtoBlog