<body style="width:99.5%;overflow:hidden;background:#F7F7F7;">
<div id="timer" style="float:right;margin-top:-20px;margin-right:10px"></div>
</body>
<script>
//界面倒计时
var interval=setInterval("getCountdown()",1000);
var m = 4; //分
var s = 60; //秒
function getCountdown(){
var html="";
if(m==0 && s==0){ //倒计时结束
window.location.href='/com/gm/pcQuery/main.jsp';
}else if(m>=0){
if(s>0){
s--;
}else if(s==0){
m--;
s=59;
}
}
html+="<lable style='font-size:20px;color:red;'>5分钟后自动回到主界面: "+m+":"+(s>9?s:"0"+s)+"</lable>";
$("#timer").html(html);
}
</script>
效果图: