Created
June 21, 2013 15:56
-
-
Save kswlee/5832191 to your computer and use it in GitHub Desktop.
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
| $.fn.lineHeight = function() { | |
| if (this.length <= 0) return 0; | |
| var clone = $(this[0]).clone().empty().appendTo($('body')).html(' '); | |
| var baseheight = clone.height(); | |
| clone.html(' <br> '); | |
| var lineheight = clone.height() - baseheight; | |
| clone.remove(); | |
| return lineheight; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment