How to determine a 'line-height' using Javascript (jQuery)? -
OK, a plugin faced a line-height coding requirement, therefore, can you give a suggestion Are you, please? Thank you)
You should not be assured of getting a count line height in the pixel cross-browser Sometimes the value is 'normal' or 'inheritance', which counts in Firefox, but not in IE, for example. For this, a workaround (depending on the case of your use) can get the count font size (which you can see ), and multiply it by 1.5, which is quite large:
var fontSize = $ (el) .css ('font-size'); Var LineHyat = Math.flur (persian (font size. Rellest ('PX', '')) * 1.5); Yes, it is a bit gross, but for some things like determining the right height of an element based on some lines, it will work fine, for example. Keep in mind, you can replace 1.5 with any standard line-height / font-size ratio that you can already use on your site. If you do not know, then you can calculate and calculate any copy element in firebug a) Font-size and B) Replace with line-height after 1.5 / b. :-) Hope this is useful!
Comments
Post a Comment