Ver Mensaje Individual
  #2 (permalink)  
Antiguo 23/05/2012, 07:45
Avatar de djaevi
djaevi
 
Fecha de Ingreso: marzo-2007
Ubicación: Moreno, Buenos Aires
Mensajes: 400
Antigüedad: 17 años, 1 mes
Puntos: 47
Respuesta: Opcion a cambiar tamaño de letra como los periódicos OnLine

Te dejo un ejemplo muy simple aver si te sirve para adaptarlo a tu proyecto si tienes alguna duda me avisas.

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  4. <title>Untitled Document</title>
  5.     #contenedor {
  6.         position:absolute;
  7.         width:770px;
  8.         left:50%;
  9.         margin-left:-385px;
  10.     }
  11.    
  12.     #head {
  13.         background-image:url(head.png);
  14.         height:20px;
  15.         width:100%;
  16.     }
  17.    
  18.     #body {
  19.         background-image:url(body.png);
  20.         width:100%;
  21.     }
  22.    
  23.     #relleno {
  24.         position:relative;
  25.         top:0px;
  26.         width:90%;
  27.         left:5%;
  28.     }
  29.    
  30.     #titulo {
  31.         font-family:"Trebuchet MS";
  32.         color:#006600;
  33.         font-size:18px;
  34.         padding-bottom:10px;
  35.     }
  36.    
  37.     #noticia {
  38.         font-family:"Trebuchet MS";
  39.         color:#006666;
  40.         font-size:14px;
  41.         padding-bottom:10px;
  42.     }
  43.    
  44.     #foot {
  45.         height:20px;
  46.         width:100%;
  47.     }
  48.  
  49. <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
  50. <script type="text/javascript">
Código Javascript:
Ver original
  1. function resize(e) {   
  2.     var titulo = $("#titulo").css("font-size");
  3.     var noticia = $("#noticia").css("font-size");
  4.     var fontSizeTitulo = titulo.substring(titulo.length-2,titulo);
  5.     var fontSizeNoticia = titulo.substring(noticia.length-2,noticia);
  6.         if (e) {
  7.             $("#titulo").css("font-size",Number(fontSizeTitulo) + 2 + "px");
  8.             $("#noticia").css("font-size",Number(fontSizeNoticia) + 2 + "px");
  9.         }else{
  10.             $("#titulo").css("font-size",Number(fontSizeTitulo) - 2 + "px");
  11.             $("#noticia").css("font-size",Number(fontSizeNoticia) - 2 + "px");
  12.         }
  13.     }
Código HTML:
Ver original
  1.  
  2. </head>
  3.  
  4.     <div id="contenedor">
  5.         <div id="relleno">
  6.             <div id="titulo">
  7.                 Boca le gano al Flu
  8.             </div>
  9.             <div id="noticia">
  10.                 Con un gol de Pablo Mouche (ST 6m), el equipo de Julio Falcioni se impuso por 1-0 en la Bombonera, en la ida de los cuartos de final. La visita jugó con 10 por la expulsión de Carlinhos (PT 33m).
  11.             </div>
  12.             <div id="imgHolder">
  13.                 <img src="http://www.tycsports.com/adjuntos/104/imagenes/001/409/0001409334.jpg" />
  14.             </div>
  15.         </div><br /><br />
  16.     <a href="#" onclick="resize(false)"> Achicar </a><br />
  17.     <a href="#" onclick="resize(true)"> Agrandar </a>
  18.     </div>
  19. </body>
  20. </html>

Saludos