Bloger Trails
Increase and Decrease Font Size Widget For Blogger
This plugin uses a very simple Jquery in order to Increase and Decrease the font size of a text. This widget is useful for both you and your users especially those with poor eyesight. This widget is very This plugin uses a very simple Jquery in order to Increase and Decrease the font size of a text. This widget is useful for both you and your users especially those with poor eyesight. This widget is very essential if you want to maintain your blog's font small and at the same time turn them into big for your users.
As the user clicks on the links, font size is increased or decreased by 2 units dynamically using .css() method.
Note :
We have set the highest limit to 20px and lowest limit to 12px for the text content.
Step:
Step 2 : Adding the Code
Find (ctrl+f) </body>
Copy the following code and paste it before </body>
Find (ctrl+f) <div class='post-header-line-1'>
Copy the following code and paste it before <div class='post-header-line-1'>
Find (ctrl+f) </body>
Copy the following code and paste it before </body>
<script type="text/javascript">
$(document).ready(function() {
$('#increase').click(function(){
curSize= parseInt($('.post').css('font-size')) + 2;
if(curSize<=20)
$('.post').css('font-size', curSize);
});
$('#decrease').click(function(){
curSize= parseInt($('.post').css('font-size')) - 2;
if(curSize>=12)
$('.post').css('font-size', curSize);
});
});
</script>
Find (ctrl+f) <div class='post-header-line-1'>
Copy the following code and paste it before <div class='post-header-line-1'>
<a href="#A+" id="increase">A+</a>
<a href="#A-" id="decrease">A-</a>
Step 3 : Saving
Save your Template
Save your Template
As the user clicks on the links, font size is increased or decreased by 2 units dynamically using .css() method.
Note :
We have set the highest limit to 20px and lowest limit to 12px for the text content.
Post a Comment
0 Comments
Aslam-O-aliakum friend you Are Connecting With Me xThanks