4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: x23piracy on November 29, 2010, 03:53:32 AM

Title: [MOD] Independent Font Size Changer ▲▼ for hole page with cookie
Post by: x23piracy on November 29, 2010, 03:53:32 AM
Hi,

here is a font size changer that changes font size for all elements procentual, it also saves
the state of choosen fontsize into a cookie.

You can setup the default size and the procentual adjustment steps for in or decreasing.


Here we go:

Place in your header.html between <head></head> tag:

Code: [Select]
<script type="text/javascript" src="./js/font_cookie.js"></script>
<script type="text/javascript" src="./js/font_size.js"></script>

Place early in your header.html after the <body> tag:

Code: [Select]
<script type="text/javascript">if (efa_fontSize) efa_fontSize.efaInit();</script>
Place this in any template where you want to show the font size changer buttons:

Code: [Select]
<div class="selectFontSize"><script type="text/javascript">if (efa_fontSize) document.write(efa_fontSize.allLinks);</script></div>
Place the attached files (see post attachment) into your root/js/ directory:

- root/js/font_size.js
- root/jsfont_cookie.js
- root/js/font_zoomin_32.png
- root/js/font_normal_32.png
- root/jsfont_zoomout_32.png


Your done  :mrgreen:


Settings:

in font_size.js:

Code: [Select]
var efa_default = 70; //default text size as percentage of user default
var efa_increment = 10; //percentage to increase/decrease font size

You can play around with this two settings.

In the attachment there is also a font_size.html file, this only for local testing and is not
needed for uploading.

Here is a little teaser screenshot snip, don't wonder i just placed it for testing into my
mac like dock bar:

(http://www.xup.in/pic,54479448/temp2.jpg) (http://www.xup.in/dl,54479448/temp2.jpg/)


Greetz X23