Ver Mensaje Individual
  #18 (permalink)  
Antiguo 22/11/2013, 14:22
Avatar de IsaBelM
IsaBelM
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 5.032
Antigüedad: 15 años, 11 meses
Puntos: 1012
Respuesta: cuenta regresiva script y php por inactividad

dónde se está evaluado la inactividad?? la sesión (php) expirará cuando se cumpla el tiempo de inactividad asignada, pero en el cliente sólo veo un contador regresivo.

la segunda opción que te sugerí llevada a código
Cita:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
* {
padding: 0;
margin: 0;
position: relative;
}


html, body {
width: 100%;
height: 100%;
}


#expirado {
display: none;
width: 200px;
height: 200px;
}
</style>
<script type="text/javascript">
var tstampActual = 0;
var comprobar = 10000;

function actividad() {

var tstamp = new Date().getTime();

if (Math.abs(tstampActual - tstamp) > comprobar) {

document.getElementById('expirado').style.display = 'block';

} else {

document.getElementById('expirado').style.display = 'none';

}
}


window.addEventListener('load', function() {

document.body.addEventListener('mousemove', function() {

tstampActual = new Date().getTime();

}, false);

setInterval(function() {actividad()}, comprobar);
});


</script>
</head>
<body>

<div id="expirado">El tiempo ha expirado</div>

</body>
</html>
si hay 10 segundos de inactividad, aparece una leyenda
__________________
if(ViolenciaDeGénero) {alert('MUJER ASESINADA');}