Web site design and development services, La Crosse, WI. Milaju Creative

Nov 20, '09

JQuery Font Sizer - v.2!

A jQuery plugin to allow users to select the font-size of the page, or a region on the page (or website). Includes ability to set the size change amount, as well as a cookie function which will store the setting for a variably set number of days.

Demo

View the jQuery Font Sizer demo.

Implemetation

Simply include the jQuery core, the plugin file, and CSS (see default.css in the zip file). Create a container where the controls will go (which will also be what the plugin is loaded against). The defaults provide 'body' as the element to resize on, however, I highly recomment using the applyTo variable to set a region in order to prevent all content on the site from resizing which could adversly affect the layout.

$(document).ready(function(){
  $('#fontsizer').jfontsizer({
    applyTo: '#content',
    changesmall: '2',
    changelarge: '2',
    expire: 30
  });
});

Variables:

applyTo: the region which will have the font-size transformations applied to it (and any children node).  Default: 'body'

changesmall: the amount of reduction (1-10)  when the "small" control is clicked. Default: '2'

changelarge: # the amount of increase (1-10) when the "large" control is clicked. Default: '2'

expire: the amount (in days) that the cookie applied to retain the user's preference is maintained. Default: 30

Download

Download the jQuery FontSizer Plugin. Contains jQuery core, plugin (normal, min, and packed), CSS file, and HTML demo.


Filed under: jquery, plugins, development


Share



Comments

What people are saying...

Local Directory for La Crosse, Wisconsin Featured in the NationalWebsite Design Directory Sitemap