Created
April 15, 2014 12:38
-
-
Save RyoSugimoto/10729171 to your computer and use it in GitHub Desktop.
CSSのcalc()関数が使えるかどうかを調べる。
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
#css-calc { | |
width: 10px; | |
width: calc(10px + 10px); | |
width: -webkit-calc(10px + 10px); | |
display: none; | |
} |
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
var cssCalc = (function () { | |
$('body').append('<div id="css-calc"></div>'); | |
var cssCalc = Number($('#css-calc').width()); | |
$('#css-calc').remove(); | |
if(cssCalc === 10) { | |
return false; | |
} else { | |
return true; | |
} | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment