Skip to content

Instantly share code, notes, and snippets.

@miya2000
Created February 12, 2011 02:43
Show Gist options
  • Save miya2000/823432 to your computer and use it in GitHub Desktop.
Save miya2000/823432 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name jQuery - fix window height (for jQuery version 1.2.x.)
// ==/UserScript==
(function() {
function main() {
if (typeof jQuery == 'undefined') return;
if (!/^1\.2\./.test(jQuery.fn.jquery)) return;
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, arguments);
};
}
document.addEventListener('DOMContentLoaded', main, false);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment