I am trying to implement a javascript session time out popup. Please help me. I am able to show popup for first time but when i click ok next time popup is coming in next one minute.For testing i gave 3 min time. Please help me resolve this.I am not able to reset the timer on mouseclick.
</head>
<body>
<div id="dialog" style="display:none;" title="Dialog Title">Your session is going to expire in 10min</div>
<script>
var lefttime=4;
var interval;
setTimeout( 'ShowTimeoutWarning();', 180000 );
function ShowTimeoutWarning()
{
$( "#dialog" ).dialog( "open" );
return false;
}
$("#dialog").dialog({
autoOpen: false,
dialogClass: "no-close",
position: 'center' ,
title: 'session',
draggable: false,
width : 300,
height : 200,
resizable : false,
modal : true,
buttons: [
{
text: "OK",
click: function() {
ShowTimeoutWarning();
$( this ).dialog( "close" );
}
}
]
});
document.onkeyup=setTimeout( 'ShowTimeoutWarning();', 180000 );
document.onkeydown=setTimeout( 'ShowTimeoutWarning();', 180000 );
document.click=setTimeout
</script>