Fluid Text Resizer: Adjust Font Size in Blog Posts



image


I came across an excellent jQuery based text resizer script that lets your visitors to adjust, change, resize font size of your blog post. This decreases or increases the font size providing your readers with better readability. Its useful especially to those with weak eye sights and for those with display issues. Fluid Text Resizer widget has been designed by mybloggertricks and script is adopted from dynamic drive. It will appear just below your post titles and will allow your visitors to toggle the text size to their comfort. Text size on your entire blog will be zoomed in and zoomed out. From sidebars till footer, all text will be maximized. It also includes a Reset link that toggles the default font level. Lets get to work then!





Live Demo



Add Text Resizer Widget To Blogger



  1. Go To Blogger > Design > Edit HTML

  2. Backup your template

  3. Check the "Expand Widget Templates" box

  4. Search for this,




]]></b:skin>


     5.    Just below it paste the following code,


<style type='text/css'>


/*----- Text Resizer By MBT ------*/

.controlstyle a{ /*links inside DIV sizecontroldiv*/
outline:none;
}

.controlstyle a img{ /*image links inside DIV sizecontroldiv*/
border-width:0;
}

.controlstyle a.selectedcontrol img{ /*selected control&#39;s image*/
border-bottom:4px solid darkred;
}

.mbt-text-resizer{
font-weight:bold!important; color:#F07727!important; text-decoration:none!important; font-family:arial,tahoma !important; font-size:16px!important;
}



#mbt-text-resizer-container {
margin:4px 0px;
padding:4px;
border-top:1px solid #ddd;
border-bottom:1px solid #ddd; width:100%;
}
</style>

<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js' type='text/javascript'/>

<script src='http://mybloggertricks.googlecode.com/files/text%20resizer.js' type='text/javascript'>

</script>

<script type='text/javascript'>

var mytextsizer=new fluidtextresizer({
    controlsdiv: &quot;sizecontroldiv&quot;, //id of special div containing your resize controls. Enter &quot;&quot; if not defined
    targets: [&quot;body&quot;], //target elements to resize text within: [&quot;selector1&quot;, &quot;selector2&quot;, etc]
    levels: 10, //number of levels users can magnify (or shrink) text
    persist: &quot;session&quot;, //enter &quot;session&quot; or &quot;none&quot;
    animate: 200 //animation duration of text resize. Enter 0 to disable
})

</script>



    6.   Next search for this code,


<data:post.body/>

     7.   Just above it paste the following code,



<b:if cond='data:blog.pageType == &quot;item&quot;'>

<div id='mbt-text-resizer-container'>
<div class='controlstyle' id='sizecontroldiv'>
<font style='color:#666; font-weight:bold;'>Adjust the font size:</font>  <a class='mbt-text-resizer' href='#smaller'><img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIXWP5c6ILOjFub0rivpbgHFntzVdZx_zY_NEVAVQHZnAWEerbrP5aA0_GBwO4_Y2wozAGqOjZaYu2PtzI4X6FBEEC2vKYLJRl9a5eDQGZPRYFv3LknF_sCzBiTGG6qbHBb1vCRO19Qn0/s400/oranged.png'/>&#160;</a>  <a class='mbt-text-resizer' href='#bigger'><img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBIheQa08a-NBfP1quJpLZJbt4jeF5rGdbqouzza_b-EYynVDlc4XaE6Tr_F3iZ45lRMVTD31X5zQYWi9HTfISle-yP8KETZDHYwjkmnfGe94XzG43fGamU2xOJ2wPBQd00iZEFFJhcYM/s400/orangei.png'/>&#160;&#160;</a><a class='mbt-text-resizer' href='javascript:mytextsizer.setFontLevel(0)' rel='nofollow'>Reset &#8597;</a>
</div>
</div>

</b:if>

You can change the text being displayed if you wish.

     8.      Save your template and you are all done!

Visit any of your post to see it appearing just below the post title. I have turned off the widget display on homepage. If you want the widget to be displayed on homepage too then simply delete the purple lines from the code in step#7.


Need help?


Do let me know if you wish to change anything. I will publish more color variations and styles of this gadget today so stay tune. Feel free to ask anything which is still un clear for you. Peace buddies! :>