Created
December 26, 2012 22:52
-
-
Save hsquareweb/4383734 to your computer and use it in GitHub Desktop.
JS: Modernizr Box Sizing For IE7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //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