increase fontsize on language select
increase fontsize on language select
by Amal Das
HTML
<div class="selectLang">
<select>
<option value="English" selected>English</option>
<option value="Spanish">Spanish</option>
</select>
</div>
<div class="left">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
<p>
Where does it come from?
</p>
</div>
<div class="right">
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look lik
</div>
CSS
.left {
font-size: 16px;
}
.left>p {
font-size: 20px;
}
.right {
font-size: 16px;
}
JavaScript
$(function() {
$(document).on("click","div.selectLang select",function(){
var curr=$("div.selectLang select").val();
var arr=[".left",".left>p"];
if(curr=="English"){
for(var i=0;i<=arr.length;i++){
var fontSize = parseInt($(arr[i]).css("font-size"));
fontSize = fontSize - 3 + "px";
$(arr[i]).css({'font-size':fontSize});
}
} else if(curr=="Spanish"){
for(var i=0;i<=arr.length;i++){
var fontSize = parseInt($(arr[i]).css("font-size"));
fontSize = fontSize + 3 + "px";
$(arr[i]).css({'font-size':fontSize});
}
}
});
});