2
I have to apply the accessibility feature to increase and decrease font. I currently have 3 buttons: Small Font, Normal Font and Large Font.
The idea is that when you click on each button, the corresponding function is called in javascript. And that the font increase or decrease to a certain size and ready (can not increase 2px every time clicked for example, it was 12 went straight to 20 and so on).
What is complicating is that this is a big site, many classes, ids, lots of content.
I thought about making the change in the font through getelementsbytagname, but the same tag varies its size and available space according to the page.
For example we have H1 with font 50 on a page and you can increase up to 60, 70, but we also have H1 with font 20 that increases up to 30 (otherwise exceeds the page size and mocks everything).
What’s left of option then? Do class by class?
An alternative would be to dynamically charge the
css
usingjavascript
, loading a file that has all the size settings.– Ricardo Pontual
Ricardo, thanks for the idea! It worked for what I wanted.
– Recurso de Acessibilidade