Ver Mensaje Individual
  #2 (permalink)  
Antiguo 04/04/2012, 05:14
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: Aumentar valor cada cierto tiempo

Lo que estás haciendo no está mal
lo probaste?
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.  
  5. <script type="text/javascript">
  6. //<![CDATA[
  7. var variable1 = 100;
  8. function sumar() {
  9.  variable1 += .1;
  10.  // mostrar el valor de variable1
  11. document.getElementById('valor').innerHTML = variable1;
  12. document.getElementById('redondearvalor').innerHTML = Math.round(variable1*100)/100;
  13. }
  14. //]]>
  15. </head>
  16. <body onload="setInterval('sumar()',1000)">
  17. <span id="valor"><!-- mostrar valor --></span><br />
  18. <span id="redondearvalor"><!-- mostrar valor redondeado --></span>
  19. </body>
  20. </html>

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