Ver Mensaje Individual
  #7 (permalink)  
Antiguo 21/11/2013, 14:15
Avatar de Ilidam
Ilidam
 
Fecha de Ingreso: julio-2009
Ubicación: Veracruz
Mensajes: 108
Antigüedad: 14 años, 10 meses
Puntos: 0
Respuesta: cuenta regresiva script y php por inactividad

bueno lo primero ya quedo lo de la cuenta regresiva ahora ese codigo el de
setTimeout(document.getElementById('ct').style.dis play = 'inline',10); lo puse en la linea 85 y no se dispara la accion para mostrar el div flotante oculto

Código Javascript:
Ver original
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <script language="JavaScript" src="js/jquery-1.5.1.min.js"></script>
  5. <style>
  6.    
  7.  .alerta {
  8.  position: fixed; /* Le damos el valor Fixed para que flote */
  9.  background: rgba(255, 255, 255, 255); /* Color de fondo de la capa */
  10.  width: 100%;
  11.  height: 100%;
  12.  top: 0;
  13.  left: 0;
  14.  z-index: 999;
  15. }
  16. .flota{
  17.  background: white; /*Color de fondo del contenedor*/
  18.  border-radius: 2px; /* Redondeado */
  19.  box-shadow: 0px 0px 0px 2px white, 0 5px 14px black; /* Sombra exterior */
  20.  z-index: 9999;
  21.  
  22.     position:absolute;
  23.     left:428px;
  24.     top:182px;
  25.     width:223px;
  26.     height:138px;
  27.     z-index:1;
  28. }
  29.  
  30. .close{
  31.  position: absolute;
  32.  display: block;
  33.  top: -15px;
  34.  right: -15px;
  35.  cursor: pointer;
  36.  background: url(images/eliminar.png) 0px 0px no-repeat; /* Imagen del boton */
  37.  width: 30px;
  38.  height: 30px;
  39.  overflow: hidden;
  40.  text-indent: -9999px;
  41. }
  42. </style>
  43. <script>
  44.     $(document).ready(function() {
  45.  $(".close").click(function(){ //Le decimos que al dar click en ".close"...
  46.     $(".alerta").hide("drop"); //Oculte el contenedor ".overlay" lentamente(slow)
  47.   event.preventDefault(); // Anulamos el enlace...
  48.  });
  49. });
  50.  
  51. </script>
  52.  
  53. <script type="text/javascript">
  54.  function display_c(start){
  55. window.start = parseFloat(start);
  56. var end = 0 // change this to stop the counter at a higher value
  57. var refresh=1000; // Refresh rate in milli seconds
  58. if(window.start >= end ){
  59. mytime=setTimeout('display_ct()',refresh)
  60. }
  61. else {
  62.     window.location="../login.html";
  63. }
  64. }
  65.  
  66. function display_ct() {
  67. // Calculate the number of days left
  68. var days=Math.floor(window.start / 86400);
  69. // After deducting the days calculate the number of hours left
  70. var hours = Math.floor((window.start - (days * 86400 ))/3600)
  71. // After days and hours , how many minutes are left
  72. var minutes = Math.floor((window.start - (days * 86400 ) - (hours *3600 ))/60)
  73. // Finally how many seconds left after removing days, hours and minutes.
  74. var secs = Math.floor((window.start - (days * 86400 ) - (hours *3600 ) - (minutes*60)))
  75.  
  76. var x = minutes + ":" + secs + " Minutos ";
  77.  
  78.  
  79. document.getElementById('ct').innerHTML = x;
  80. window.start= window.start- 1;
  81.  
  82. tt=display_c(window.start);
  83. }
  84.  
  85. setTimeout(document.getElementById('busca').style.display = 'inline',10);//aki puse esto
  86. </script>
  87.  
  88. </head>
  89. <body onload="display_c(120);">
  90. HOLA
  91. <div class="alerta" id="busca" style="display:none"><!-- Mostrar div DURANTE 10 min de inactividad mientras este oculto-->
  92.     <div  class="flota" style=" width:397px; height:244px; ">
  93.         <div class="close">
  94.             <a href="#">Cerrar</a>
  95.         </div>
  96. <span id='ct'></span>
  97.   </div>
  98. </div>
  99.  
  100. </body>
  101. </html>

y eso del raton como es