rrenderman
asked on
increase or decrease text size - A + A
Hello everyone,
I need a very simpe funtion on a webpage where people can increase or decrease the font size.
No heavy cookies or a giant ocean of java, just as simple as can be.
( - A + A)
I allready have this:
<script>
dom = (document.all || document.getElementById)?1 :0;
function changeCss(obj,px) {
if (dom) {
if (document.all) doc = document.all;
else doc = document.getElementById;
doc(obj).style.fontSize=px +'px'
}
return false;
}
</script>
AND two buttons with small A and big A on the top of the page
<a href="#" onClick="return changeCss('t',11)"><img border="0" src="lettersize_smaller.gi f"></a></t d>
<td width="14" height="33">
<a href="#" onClick="return changeCss('t',12)"><img border="0" src="lettersize_bigger.gif "></a></td >
<td width="98" height="33">
..... this function only allowe me to change from 11 px up to 12 px... but the page has all kinds of sizes
from big headlines, small imagetext to very small contact infos in the bottom...
... So what I need is to change the function so it increase / decrease the fonts in some kind of harmony like using % percent.
Do you know any way to change the script or a similar script which is very easy to use?
I need a very simpe funtion on a webpage where people can increase or decrease the font size.
No heavy cookies or a giant ocean of java, just as simple as can be.
( - A + A)
I allready have this:
<script>
dom = (document.all || document.getElementById)?1
function changeCss(obj,px) {
if (dom) {
if (document.all) doc = document.all;
else doc = document.getElementById;
doc(obj).style.fontSize=px
}
return false;
}
</script>
AND two buttons with small A and big A on the top of the page
<a href="#" onClick="return changeCss('t',11)"><img border="0" src="lettersize_smaller.gi
<td width="14" height="33">
<a href="#" onClick="return changeCss('t',12)"><img border="0" src="lettersize_bigger.gif
<td width="98" height="33">
..... this function only allowe me to change from 11 px up to 12 px... but the page has all kinds of sizes
from big headlines, small imagetext to very small contact infos in the bottom...
... So what I need is to change the function so it increase / decrease the fonts in some kind of harmony like using % percent.
Do you know any way to change the script or a similar script which is very easy to use?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I don't see any A+ or A- on your page. Furthermore, if I press ctrl-+ all fonts get bigger, not just a portion of it. Still the concept is interesting.
The font sizer is just below the headline and byline of the story...
Delicious | Print | Email | Font Size
Delicious | Print | Email | Font Size
Sorry, totally missed that! It looks nice!
Thanks! Let me know if you have any questions on the implementation... I might even remember how it works :)
Just wondering if you ever had any luck.
Forced accept.
Computer101
EE Admin
Computer101
EE Admin