$(function() {
var timeout = 15000; // in seconds
$(document).bind("idle.idleTimer", function() {
// function you want to fire when the user goes idle
$.timeoutDialog({ timeout: 0.25, countdown: 15, logout_redirect_url: 'http://www.google.com', restart_on_yes: true });
});
$(document).bind("active.idleTimer", function() {
// function you want to fire when the user becomes active again
});
$.idleTimer(timeout);
});
with reference ====
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.js"></script>
<script type="text/javascript" src="js/jquery.idle-timer.js"></script>
<script type="text/javascript" src="js/timeout-dialog.js"></script>