I'm currently working on a website where the body has a specified font-size property that is inherited by all elements on the page.
- Some tags on the page have font-sizes specified in percentages (%).
- Others are assigned sizes in pixels (px).
I'm attempting to create a font resizer that functions properly.
$('.internal-article *').each(function( index ) {
var FontSize = $(this).css("fontSize");
var FontSize = parseFloat(FontSize, 10);
FontSize = FontSize + 1;
$(this).css("font-size",FontSize+"px");
});
This approach doesn't work for pages where fonts are specified in pixels since it references the parent element's font size, which may have already been increased during the traversal process.
If you have any suggestions or insights, please share them with me. Thank you!