Ver Mensaje Individual
  #2 (permalink)  
Antiguo 08/11/2014, 05:47
Avatar de IsaBelM
IsaBelM
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 5.032
Antigüedad: 15 años, 10 meses
Puntos: 1012
Respuesta: cerrar sesión por inactividad

si hay 10 segundos sin actividad, muestra la leyenda
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">
#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 = 'inline';

} else {

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

}
}


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

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

tstampActual = new Date().getTime();

}, false);

setInterval(actividad, comprobar);
});


</script>
</head>
<body>

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

</body>
</html>
__________________
if(ViolenciaDeGénero) {alert('MUJER ASESINADA');}