Potřeboval bych spojit tyto dvě funkce dohromady, ale nevím jak: Neaktivita stisknutí klávesnice: $(document).ready(function () { var idleState = false; var idleTimer = null; $('*').bind('keypress keypress', function () { clearTimeout(idleTimer); if (idleState == true) { $("textarea").css('background-color','#fff'); } idleState = false; idleTimer = setTimeout(function () { $("textarea").css('background-color','#dedede'); idleState = true; }, 2000); }); $("textarea").trigger("keypress"); }); Odpočet: function startTimer(duration, display) { var timer = duration, minutes, seconds; setInterval(function () { minutes = parseInt(timer / 60, 10); seconds = parseInt(timer % 60, 10); minutes = minutes < 10 ? "0" + minutes : minutes; seconds = seconds < 10 ? "0" + seconds : seconds; display.textContent = minutes + ":" + seconds; if (--timer < 0) { timer = duration; } }, 1000); } window.onload = function () { var fiveMinutes = 60 * 5, display = document.querySelector('#time'); startTimer(fiveMinutes, display); }; Potřeboval bych tyto dvě scripty sloučit tak, aby při neaktivitě se spustilo odpočet... Vahan pottar@seznam.cz