Created
April 8, 2014 11:02
-
-
Save boldfacedesign/10109942 to your computer and use it in GitHub Desktop.
TEST FOR SUPPORT OF MIN-HEIGHT ON DISPLAY TABLE ELEMENTS
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
| //TEST FOR SUPPORT OF MIN-HEIGHT ON DISPLAY TABLE ELEMENTS | |
| (function() { | |
| //CREATE ELEMENT IN DOM | |
| var elem = document.createElement('div'); | |
| //ADD STYLES | |
| elem.style.display = 'table'; | |
| elem.style.minHeight = '2px'; | |
| //APPEND TO DOM | |
| document.body.appendChild(elem); | |
| //MEASURE HEIGHT | |
| if (elem.clientHeight > 0) { | |
| document.getElementsByTagName('html')[0].className += ' table-min-height'; | |
| } else { | |
| document.getElementsByTagName('html')[0].className += ' no-table-min-height'; | |
| } | |
| elem.parentNode.removeChild(elem); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment