Font Size

This method is used to change the font size of the webpage. Using this, users can increase the font size for a more comfortable reading experience. It is especially useful for audiences with slight visual impairment, like senior citizens.


The parameters allowed are:

Parameter Code Description
Increases the font size by 10%.
Decreases the font size by 10%.
Reverts the font size to the page's default.
Pixel value
Changes the font size to the specified value.

You can add these methods to a button with a onclick events, for example:

<button onclick="agastya.fontSize('increase')">A+</button>
<button onclick="agastya.fontSize('normal')">A</button>
<button onclick="agastya.fontSize('decrease')">A&minus;</button>
<button onclick="agastya.reset('fontSize')">Reset</button>

Another implementation could be a slider.

	Change font size: 
	<input type="range" onchange="agastya.fontSize(this.value+'%')" min="80" max="120" value="100">
<button onclick="agastya.reset('fontSize')">Reset</button>