ccc

JS: Mostrar un mensaje (o hacer lo que sea) cuando la página lleva inactiva más de 10 segundos

<script>
    //Time inactive to lockscreen
    inactive = 0;
    var idleInterval = setInterval(function(){
        inactive++;
        console.log(inactive);
        if (inactive == 10){
            console.log('Lockscreen');
            //$('iframe').show();
        }
    }, 1000);

    $(document).bind('mouseover click keydown scroll', function () {
        inactive = 0;
    });
</script>

No hay comentarios:

Publicar un comentario