The jFontSize plugin was developed to facilitate the process of creating the famous buttons A+ and A-, which alter the font size on sites with very large texts, such as blogs, journals, tutorials, etc.
This tool is also used to increase the accessibility of sites, helping people who have visual problems to see better content
<a id="jfontsize-minus" href="#">A-</a> <a id="jfontsize-default" href="#">A</a> <a id="jfontsize-plus" href="#">A+</a> <p class="some-class-name">This text will be resized</p>
.jfontsize-button {
font: bold 12px arial;
padding: 3px;
border: solid 1px #ccc;
}
.jfontsize-button:hover {
text-decoration: none;
background: #333;
color: #fff;
border: solid 1px #333;
}
.jfontsize-disabled, .jfontsize-disabled:hover {
color: #aaa;
border: solid 1px #eee;
background: #eee;
}
$('.some-class-name').jfontsize();
$('.some-class-name').jfontsize();
$('.some-class-name').jfontsize({
btnMinusClasseId: '#minus-btn',
btnDefaultClasseId: '#default-btn',
btnPlusClasseId: '#plus-btn',
btnMinusMaxHits: 5,
btnPlusMaxHits: 8,
sizeChange: 5
});
| Attribute | Type | Default | Description |
|---|---|---|---|
| btnMinusClasseId | CSS Class or Id | #jfontsize-minus | Defines the class or id of the decrease button |
| btnDeafultClasseId | CSS Class or Id | #jfontsize-default | Defines the class or id of default size button |
| btnPlusClasseId | CSS Class or Id | #jfontsize-plus | Defines the class or id of the increase button |
| btnMinusMaxHits | Integer | 10 | Defines how many times the size can be decreased |
| btnPlusMaxHits | Integer | 10 | Defines how many times the size can be increased |
| sizeChange | Integer | 1 | Defines the range of change in pixels |