Bootstrap Templates Bundle

Thursday, January 17, 2013

Allow user to change font size- Fluid Text Resizer

Step 1: Add the following code to the <HEAD> section of your web page:

<!-- font -->
<style type="text/css">

.controlstyle a{ /*links inside DIV sizecontroldiv*/
float: right;

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

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


<script type="text/javascript" src=""></script>

<script type="text/javascript" src="">

* Fluid Text Resizer- © Dynamic Drive DHTML code library (
* Visit for hundreds of DHTML scripts
* This notice must stay intact for legal use


<script type="text/javascript">

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


<!-- font -->

Step 2: Now add the following sample resize controls to your page:

 <!-- font -->

<div id="sizecontroldiv" class="controlstyle">

 <a href="#smaller"><img src="" /></a> <a href="javascript:mytextsizer.setFontLevel(0)"><a href="#fontsize2"><img src="" /></a></a> <a href="#bigger"><img src="" /></a>

<!-- font -->


No comments:

Post a Comment

Wokiee React eCommerce Template