hat sich erledigt, hier ein sample das ich für unsere seite gebastelt habe.
PHP-Code:
<script type="text/javascript">
var running = false
var endTime = null
var timerID = null
var totalMinutes = 20;
function startTimer() {
running = true
now = new Date()
now = now.getTime()
endTime = now + (1000 * 60 * totalMinutes);
showCountDown()
}
function showCountDown() {
var now = new Date()
now = now.getTime()
if (endTime - now <= 0) {
clearTimeout(timerID)
running = false
alert("Zu Ihrer eigenen Sicherheit werden Sie automatisch Abgemeldet!")
document.getElementById('SessionTimeCount').innerHTML = " automatisch Abgemeldet!"
// window.location.replace ( "/index.php?option=logout" ) ;
} else {
var delta = new Date(endTime - now)
var theMin = delta.getMinutes()
var theSec = delta.getSeconds()
var theTime = theMin
theTime += ((theSec < 10) ? ":0" : ":") + theSec
document.getElementById('SessionTimeCount').innerHTML = " (Abmeldung in " + theTime + " Minuten)"
if (running) {
timerID = setTimeout("showCountDown()",900)
}
}
}
</script>
<body onLoad="startTimer();"></body>
<span id="SessionTimeCount"></span>
gruss Breiti
Lesezeichen