Skip to content

Instantly share code, notes, and snippets.

@hsquareweb
Created December 26, 2012 22:52
Show Gist options
  • Select an option

  • Save hsquareweb/4383734 to your computer and use it in GitHub Desktop.

Select an option

Save hsquareweb/4383734 to your computer and use it in GitHub Desktop.
JS: Modernizr Box Sizing For IE7
//MODERNIZR BOX SIZING FIX FOR IE7
Modernizr.addTest("boxsizing", function() {
return Modernizr.testAllProps("boxSizing") && (document.documentMode === undefined || document.documentMode > 7);
});
$(function(){
if(!Modernizr.boxsizing){
$('.col1, .col2').each(function(){
var fullW = $(this).outerWidth(),
actualW = $(this).width(),
wDiff = fullW - actualW,
newW = actualW - wDiff;
$(this).css('width',newW);
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment