The Arcive of vBulletin Modifications Site. |
|
Easy Style font resizer Details »»
|
|||||||||||||||||||||||||
The following script can be used to allow visitors to increase or decrease the size of text on your page. This can be useful for visitors who have trouble reading smaller text and allows them to increase it to something they can view more easily.
Template edits: add the following script in Header Code:
<script type="text/javascript" language="javascript">
var min=8;
var max=18;
function increaseFontSize() {
var p = document.getElementsByTagName('div');
for(i=0;i<p.length;i++) {
if(p[i].style.fontSize) {
var s = parseInt(p[i].style.fontSize.replace("px",""));
} else {
var s = 12;
}
if(s!=max) {
s += 1;
}
p[i].style.fontSize = s+"px"
}
}
function decreaseFontSize() {
var p = document.getElementsByTagName('div');
for(i=0;i<p.length;i++) {
if(p[i].style.fontSize) {
var s = parseInt(p[i].style.fontSize.replace("px",""));
} else {
var s = 12;
}
if(s!=min) {
s -= 1;
}
p[i].style.fontSize = s+"px"
}
}
</script>
Code:
<div>
<a href="javascript:increaseFontSize();"><img src="font-inc.gif" alt="Increase Font Size" style="border:0px;" /></a>
<a href="javascript:decreaseFontSize();"><img src="font-dec.gif" alt="Decrease Font Size" style="border:0px;" /></a>
</div>
![]() Demo: http://fa.animcentral.com/forums/ comment: Persian Language Show Your Support
|
|||||||||||||||||||||||||
| Благодарность от: | ||
| xorex | ||
| Comments |
|
#2
|
||||
|
||||
|
so good.
Thanks |
|
#3
|
||||
|
||||
|
itz nice..
|
|
#4
|
|||
|
|||
|
It changes back to normal every page load, i find it easier to hold down ctrl then scroll the mouse wheel.
|
|
#5
|
||||
|
||||
|
i will try to make it cookie base in next version
|
|
#6
|
|||
|
|||
|
Nice, thanks.
|
|
#7
|
|||
|
|||
|
thank you
|
|
#8
|
|||
|
|||
|
Thanks for this nice mod , we need to see it cookie support in next versions , because when you move to an page , the font return as it default .
Thanks , Zi5 |
|
#9
|
||||
|
||||
|
Nice mod. Although I have always used "Ctrl" and " +" keys for changing the display of the font size... I think it would be more useful if you make it cookie base.
Thank you anyway. |
|
#10
|
||||
|
||||
|
I hope to see this made cookie-based at one point, too.
Regards, Kevin |
![]() |
|
|