<html>
<head>
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript">
window.onload = function () {
count();
setInterval("count()",2*1000);
}
var isopen=true;
var i=0;
function count(){
if(isopen){
OpenWindow("winPopup.html",250,250,"计数显示");
wtype=false;
}
$("#c").html(i++);
}
function OpenWindow(url,width,height,name)
{
var left = screen.width-width-50;
var top = screen.height-height-80;
var newWin = window.open(url,"newwindow","left=" +left+",top="+top+",width="+width+",height="+height+",toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no status=no");
newWin.focus();
return newWin;
}
/*html5 IE不支持
function notify(){
//判断浏览器是否支持notification
if(window.webkitNotifications){
//判断当前页面是否被允许发出通知
if(webkitNotifications.checkPermission==0){
var icon_url = 'http://www.w3.org/';
var title = 'Hello HTML5';
var body = 'I will be always here waiting for you!';
var WebkitNotification = webkitNotifications.createNotification(icon_url, title, body);
WebkitNotification.show();
}else{
document.getElementById('requestbutton').onclick = function () {
webkitNotifications.requestPermission();
};
}
}else alert("您的浏览器不支持桌面通知特性,请下载谷歌浏览器试用该功能");
}*/
</script>
<title>弹窗模式</title>
</head>
<body>
<div>弹窗显示</div>
<div id="tc">
<div>计数器</div>
<div id="c"></div>
</div>
</body>
</html>