jQuery 1.8 outer Height/Width not working jQuery 1.8 outer Height/Width not working jquery jquery

jQuery 1.8 outer Height/Width not working


This is actually a known jQuery bug that you can read about here.

I'm experiencing it with no parameter and the fix is setting the parameter (even though there's a default {false}), but I was able to break Barlas' fiddle by replacing the true parameter with 1 and false with 0. So don't do that if you are.

Do this:

alert(jQuery(this).outerHeight(false));

Don't do this:

alert(jQuery(this).outerHeight());alert(jQuery(this).outerHeight(0));


It only works if I do .outerHeight(1); not .outerHeight(true);


The best fix is to pass the Boolean parameter true or false when calling outerHeight or outerWidth

But..

If by any chance you don't have access to files which calls outerHeight or you don't want to edit all outerHeight functions in your files, you can override the jQuery outerHeight function like below to make it always pass the true parameter

var oldOuterHeight =  $.fn.outerHeight;$.fn.outerHeight = function () {     return oldOuterHeight.apply(this, [true]);};