Text Resizer for Your Blogger Posts – Javascript, Widget


From this hack site visitors or blog visitors can dynamically change the font sizes of your post or page. The font size can also be changed in your browser by using the ‘ctrl button ‘ and the ‘mouse wheel‘. This can be useful for visitors those who have trouble reading smaller text and allows them to increase it to something they can view more easily.This hack will show how to add “Text Resizer” functionality in your blogs. You can see the demo of this hack here.

+/- Grab Text Resizer Widget

Step 1. Login in to Blogger Dashboard.

Step 2. Go to Edit Html >> Layout ( Back up your template first )

Step 3. Paste the following CSS code right above ]]></b:skin>

CSS Code Section

.textresize {
padding-left:20px;
padding-top:5px;
}

Step 4. Paste the following Javascript code right above </head> section.

Javascript Code Section
<script language="JavaScript" type="text/javascript">
function changeFontSize(inc)
{
  var p = document.getElementsByTagName(‘p’);
  for(n=0; n<p.length; n++) {
    if(p[n].style.fontSize) {
       var size = parseInt(p[n].style.fontSize.replace("px", ""));
    } else {
       var size = 12;
    }
    p[n].style.fontSize = size+inc + ‘px’;
   }
}
</script>

Troubleshooting Possible error message
while saving your template if you get error message related to ‘p.length‘ ie. p.length needs to be terminated by > or />. For this just replace <p.length with &lt;p.length in above code.

Step 5. Now Search for this line <div class=’post header-line-1> or similar line ( ..line-2 or ..line-3) and Paste following code right below it or somewhere appropriate to you.

Text Size [+]|[-] link Code
<span class=’textresize’>
Text Size :<a href=’javascript:changeFontSize(1)’> [+]</a> | <a href=’javascript:changeFontSize(-1)’> [-]</a>
</span>

Step 6.Preview and Save your Template.

If you like this post, don’t forget to subscribe to RSS feed or Email.

Featured Items - Unlimited Web Hosting from HostGator 25% OFF

HostGator is a one of the most trusted Easy and Affordable Web Hosting Provider next to Inmotion Hosting. LIMITED TIME OFFER! Get 25% OFF using coupon code: BLOGOSYS25
FIND OUT MORE

Featured Items - Start Your Own Community Website Like Facebook In a Minute

Want to start your own social or community website like Facebook ? Start right away using Buddypress WordPress plugin along with premium Buddypress Themes. No need to setup anything. It works out of box. Install BuddyPress plugin and Premium themes from this list. Your are done!.
FIND OUT MORE

Featured Items - Top Selling WordPress Themes From Themeforest

Want to use one of the top selling WordPress theme for your next project?   Here is the list of Premium WordPress items from Blog, Magazine, Creative, Retail, Technology, Entertainment, BuddyPress, eCommerce and Nonprofit categories.
FIND OUT MORE

Featured Items - 200+ Popular HTML Email and Newsletter Templates for Effective Marketing

Do you want to market your products effectively ? Do you want to send newsletter to your customer in the way that you want ? Do you want full control over the email design ? There are 200+ great collection of E-mail and Newsletter HTML templates from Themeforest. Get into site directly and search for the suitable template that boost your sales and conversion rate.
FIND OUT MORE

Featured Items - Collection of Best Premium Portfolio WordPress themes

Need to showcase your project work in a stunning way? These premium Portfolio WordPress themes will make your work easy for you. Perfect for showcasing Project, Photography, Video and Art work.
FIND OUT MORE
  • inner voice

    Its not working on my blog .it is only resizing title of blog.PLEASE HAVE A LOOK HELP…..