Fluid Text Resizer

This is code provided by DynamicDrive.com and customized for a custom Lotus Domino implementation. I'm providing the code for my implementation along with the original files and a PDF with the original instructions.
Custom Tools • HTML • JavaScript • Lotus Notes Form

Detach the "fluidtextresizer.js" file and upload to the Shared Resources > Files section of a database of your choosing.

Paste this into the HTML Head Content of your form and adjust the path for the JS file accordingly.

"<script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js\"></script>
<script type=\"text/javascript\" src=\"" + "/cd/source.nsf/fluidtextresizer.js\">
/***********************************************
* Fluid Text Resizer- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts.  This notice must stay intact for legal use
***********************************************/
</script>
<script type=\"text/javascript\">
var mytextsizer=new fluidtextresizer({
	controlsdiv: \"sizecontroldiv\", //id of special div containing your resize controls. Enter \"\" if not defined
	targets: [\"body\", \"table.entryroingtbl td\"], //target elements to resize text within: [\"selector1\", \"selector2\", etc]
	levels: 3, //number of levels users can magnify (or shrink) text
	persist: \"none\", //enter \"session\" or \"none\"
	animate: 200 //animation duration of text resize. Enter 0 to disable
})
</script>"

Here's the HTML for your buttons.

"<div id=\"sizecontroldiv\" style=\"display:inline-block;display:inline; margin-right:10px;\">"+
	"<a title=\"decrease font size\" class=\"iconlink iconfontdecrease\" href=\"#smaller\"></a>"+
	"<a title=\"reset font size to default\" class=\"iconlink iconfontdefault\" href=\"javascript:mytextsizer.setFontLevel(0)\"></a>"+
	"<a title=\"increase font size\" class=\"iconlink iconfontincrease\" href=\"#bigger\"></a>"+
"</div>";

Here's the CSS for the buttons.

a.iconlink {
	display:inline-block;
	height:16px;
	width:16px;
	margin-left:2px;
	text-decoration:none;
}
a.iconlink:hover {
	background-position: 0 0;
	color:#262626;
}

a.iconfontdecrease {width:26px; background: url(<Computed Value>ds16_font_size_decrease_inv.png) 0px -16px no-repeat;}

a.iconfontdefault {background: url(<Computed Value>ds16_font_size.png) 0px -16px no-repeat;}

a.iconfontincrease {width:26px; background: url(<Computed Value>ds16_font_size_increase.png) 0px -16px no-repeat;}

ORIGINAL HEAD CODE

<style type="text/css">

.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's image*/
border-bottom:4px solid darkred;
}

</style>

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

<script type="text/javascript" src="fluidtextresizer.js">

/***********************************************
* Fluid Text Resizer- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/

</script>

<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
})

</script>

ORIGINAL HTML

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

Increase/Decrease controls: <a href="#smaller"><img src="fontminus.gif" /></a>  <a href="#bigger"><img src="fontplus.gif" /></a><br /><br />

Font levels controls: <a href="#fontsize-1"><img src="-1.gif" /></a> <a href="#fontsize0"><img src="0.gif" /></a> <a href="#fontsize1"><img src="1.gif" /></a> <a href="#fontsize2"><img src="2.gif" /></a>

</div>

<p>Arbitrary link control: <a href="javascript:mytextsizer.setFontLevel(0)">Set font level to default</a>

Images/Screenshots:
Attached files

ds16_font_size.png


28,270 bytes

Posted by fbrefere001 on Tuesday November 20, 2012