Last active
August 29, 2015 14:20
-
-
Save omurphy27/d5a24d1d4d1a45b3d6f3 to your computer and use it in GitHub Desktop.
Using modernizr to detect support for the CSS Calc() property
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
// Using modernizr to detect support for the CSS Calc() property | |
// Especially useful because older phone browsers don't support Calc() | |
// source http://stackoverflow.com/questions/18359506/using-modernizr-to-test-browser-support-for-css-calc | |
// use and include special modernizr build: http://modernizr.com/download/#-shiv-cssclasses-prefixes-css_calc-load | |
supportsCalc(); | |
function supportsCalc() { | |
if (!Modernizr.csscalc) { | |
$('body').addClass('calc-no-bueno'); | |
// add css class to body if calc isn't supported | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment