Hola otra vez:
Esto a mi me funciona:
Código PHP:
<html>
<head>
<title>Zoom in/out en textos</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT type=text/javascript>
cookie_name = "fontsize";
function setCookie() {
if(document.cookie != document.cookie) {
index = document.cookie.indexOf(cookie_name);
}
else {
index = -1;
}
if (index == -1) {
document.cookie=cookie_name+"="+newsfont+"; expires=Monday, 01-Apr-2008 05:00:00 GMT";
}
}
function getCookie() {
if(document.cookie) {
index = document.cookie.indexOf(cookie_name);
if (index != -1) {
namestart = (document.cookie.indexOf("=", index) + 1);
nameend = document.cookie.indexOf(";", index);
if (nameend == -1) nameend = document.cookie.length;
val = document.cookie.substring(namestart, nameend);
return parseInt(val);
}
}
}
</SCRIPT>
<SCRIPT type=text/javascript>
var newsfont = 10;
function changeFont(id) {
if (document.getElementById) {
document.getElementById(id).style.fontSize = newsfont+"px";
} else {
if (document.layers) {
document.layers[id].fontSize = newsfont+"px";
} else {
if (document.all) {
eval("document.all." + id + ".style.fontSize = \"" + newsfont + "px \"");
}
}
}
// esto arregla scroll al utilizar layers
// updateHeight();
setCookie();
}
// aqui se produce el error
function larger() {
if (newsfont < 25) {
newsfont= newsfont +2;
changeFont('content');
}
}
function smaller() {
if (newsfont > 5) {
newsfont= newsfont -2;
changeFont('content');
}
}
</SCRIPT>
<style type="text/css">
<!--
.news {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #666666;
}
.date {
COLOR: #990066;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
}
.menu {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: bold;
color: #000000;
}
a:link {
text-decoration: none;
color: #000000;
}
a:visited {
color: #333333;
text-decoration: none;
}
a:hover {
color: #CC9900;
text-decoration: none;
}
a:active {
color: #CC9900;
text-decoration: none;
}
-->
</style>
</head>
<body bgcolor="#999999" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >
<table width="400" border="0" cellpadding="8" cellspacing="0">
<tr>
<td width="300" rowspan="2" bgcolor="#FFFFFF" class="news" id="content"><span class="date">Lorem
ipsum dolor sit amet, consectetuer</span> adipiscing elit, sed diam nonummy
nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut
wisi enim ad minim veniam, quis nostrud exercitation ulliam corper suscipit
lobortis nisl ut aliquip ex ea commodo consequat. Duis autem veleum iriure
dolor in hendrerit in vulputate velit esse molestie consequat, vel willum
lunombro dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto
odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore
te feugait nulla facilisi.
</td>
<td width="100" align="center" valign="top" bgcolor="#EEEEEE" class="menu">
<A onmousedown="larger()" href="javascript:void(0);">Aumentar</A><br>
<br>
<A onmousedown="smaller()" href="javascript:void(0);">Reducir</A></td>
</tr>
<tr>
<td bgcolor="#EEEEEE"> </td>
</tr>
</table>
</body>
</html>
Donde había que poner el ID era en changefont...
Saludos