Forum Moderators: not2easy
I just installed B2Evolution, and was thinking of adding a text size module to it. What I meant by text size module for example, there will be 2 buttons, one is increase text size and another one is decrease text size. So when user click on either increase text size or decrease text size, the fonts on the site will be decrease or increase automatically.
Is there any such CSS module which allow me to do install it and do that?
Triggering a font resize larger or smaller comes down to three basic techniques:
1) If the page is using percentages and ems (NOT pixels, or points, or any other absolute CSS unit) all you have to do to resize the text is change the pixel size on the body element of the page.
2) If the page is sizing different elements to different sizes using pixels then you can iterate through the entire page using the document.getElementsByTagName('*') collection or the equivalent and query each element for its current font size and bump it up or down. (This can be done quite quickly - much faster than it sounds.)
3) You can swap out stylesheets.
A search will bring up lots of code related to all three of these techniques.