muchas gracias ya me funciono asi
dejo el codigo por si alguien le sirve
Código PHP:
Ver original<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="JavaScript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript">if(typeof jQuery==='undefined'){document.write(unescape("<scri"+"pt src='js/jquery-1.3.2.min.js' type='text/javascript'></scri"+"pt>"));}</script>
<style>
html { background-image: url(images/glowcolor.png); }
.alerta {
position: fixed; /* Le damos el valor Fixed para que flote */
background: #FFF; /* Color de fondo de la capa */
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: 999;
display:none;
}
.flota{
opacity:1.0; /* opacidad del 60% */
filter:alpha(opacity=100); /* Opacidad para IE8 y earlier */
background: rgba(255, 255, 255, 0.50); /* Color de fondo de la capa */
border-radius: 8px; /* Redondeado */
box-shadow: 0px 0px 0px 1px black, 5px 5px 14px black; /* Sombra exterior */
position:absolute;
left:50%;
top:50%;
margin-left:-112px;
margin-top:-70px;
width:224px;
height:140px;
z-index:1;
color:#000;
}
.flota h2 {
margin:auto;
text-align:center;
}
.flota span {
text-align:center;
width:100%;
position:inherit;
margin-top:20%;
font-size:36px;
}
.close{
position: absolute;
display: block;
top: 0;
right: 2;
cursor: pointer;
background: url(images/eliminar.png) 0px 0px no-repeat; /* Imagen del boton */
width: auto;
height: 30px;
overflow: hidden;
}
</style>
<script>
$(document).ready(function() {
$(".close").click(function(){ //Le decimos que al dar click en ".close"...
$(".alerta").hide("slow"); //Oculte el contenedor ".overlay" lentamente(slow)
window.clearInterval(mytime); // Delete interval
$.ajax({ type: "GET",url: "expira.php" });
display_c(120); // Redefine time for new session expire
event.preventDefault(); // Anulamos el enlace...
});
});
</script>
<script type="text/javascript">
function display_c(start){
window.start = parseFloat(start);
var end = 0 // change this to stop the counter at a higher value var refresh=1000; // Refresh rate in milli seconds
var timeShow = 119;
if(window
.start
>= end ){ if(window.start <= timeShow){
$(".alerta").show();
}
mytime=setTimeout('display_ct()',refresh)
}
else {
window.location="../login.html";
}
}
function display_ct() {
// Calculate the number of days left
var days
=Math
.floor(window
.start
/ 86400); // After deducting the days calculate the number of hours left
var hours
= Math
.floor((window
.start
- (days
* 86400 ))/3600) // After days and hours , how many minutes are left
var minutes
= Math
.floor((window
.start
- (days
* 86400 ) - (hours
*3600 ))/60) // Finally how many seconds left after removing days, hours and minutes.
var secs
= Math
.floor((window
.start
- (days
* 86400 ) - (hours
*3600 ) - (minutes
*60)))
var x = minutes + ":" + secs + " Minutos ";
document.getElementById('ct').innerHTML = x;
window.start = window.start - 1;
tt=display_c(window.start);
}
setTimeout('display_ct()',refresh);
}
</script>
</head>
<body onload="display_c(120);">
HOLA
<div
class="alerta" id
="busca" ><!-- Mostrar div DURANTE
10 min de inactividad mientras este oculto
--> <div class="flota" style=" width:397px; height:244px; ">
<div class="close">
<a href="#">Cerrar</a>
</div>
<h2>La sessión caducara en </h2>
<span id='ct'></span>
</div>
</div>
</body>
</html>