JSFiddle - React, Tailwind, and code Playground
by Nag Shankar
HTML
<a href="" id="large">Large</a>
<a href="" id="medium">Medium</a>
<a href="" id="small">Small</a>
<div>
<p>
Lorem ispsum dolor
</p>
<h1>
Lorem ispsum dolor Lorem ispsum dolor Lorem ispsum dolor
</h1>
<h3>
Lorem Ipsum
</h3>
</div>
JavaScript
$("#large").click(function() {
$(this).unbind('click');
$("#medium").bind('click');
$("#small").bind('click');
$("div").children().each(function() {
var size = parseInt($(this).css("font-size"));
size = size + 1 + "px";
$(this).css({
'font-size': size
});
});
});
$("#medium").click(function() {
$(this).unbind('click');
$("#large").bind('click');
$("#small").bind('click');
$("div").children().each(function() {
var size = parseInt($(this).css("font-size"));
size = size + 0 + "px";
$(this).css({
'font-size': size
});
});
});
$("#small").click(function() {
$(this).unbind('click');
$("#medium").bind('click');
$("#small").bind('click');
$("div").children().each(function() {
var size = parseInt($(this).css("font-size"));
size = size - 3 + "px";
$(this).css({
'font-size': size
});
});
});