Ver Mensaje Individual
  #7 (permalink)  
Antiguo 19/11/2012, 08:20
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 10 meses
Puntos: 1567
Respuesta: CSS de objeto dinámico

Cita:
Iniciado por Albuss Ver Mensaje
aunque puedes ponerme un ejemplo si me equivoco.
Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <title>titulo</title>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6.  
  7. <style type="text/css">
  8. /*<![CDATA[*/
  9.  
  10. #divCAJABOX{
  11. background: lime;
  12. width: 300px;
  13. height: 200px;
  14. }
  15. /*]]>*/
  16. <script type="text/javascript">
  17. //<![CDATA[
  18. function tr(MiVariable){
  19. document.getElementById('divCAJABOX').style.margin ="10px " + MiVariable + "px";
  20. document.getElementById('divCAJABOX').style.border ='solid #000 '+(3+MiVariable)+'px';
  21. document.getElementById('divCAJABOX').innerHTML ="texto <br \/> " +(3*MiVariable) + "<br \/>texto<br \/>" + (3+MiVariable);
  22. }
  23. //]]>
  24. </head>
  25. <button  onclick="tr(20);">modificar</button>
  26. <div id="divCAJABOX">
  27. xxxxx
  28. </div>
  29. </body>
  30. </html>

Funciona de las dos formas
SAludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.