Created
December 13, 2013 16:26
-
-
Save Voronenko/7946863 to your computer and use it in GitHub Desktop.
Reliable way to get line-height of the particular html element with JQuery
This file contains 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
function dirty_lineheight_px(obj) { | |
$(obj).append("<div id='dirty_lineheight_px' style='position:absolute; visibility:hidden'>S</div>"); | |
// measure | |
var temp_height = $('#dirty_lineheight_px').height(); | |
// cut | |
$('#dirty_lineheight_px').remove(); | |
return temp_height; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment