YongGe

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
用javascript作类似于QQ用户上线的消息提示框,兼容IE7,firefox
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

 
<title> www.svnhost.cn </title>

 
<meta name="generator" content="editplus" />

 
<meta name="author" content="" />

 
<meta name="keywords" content="" />

 
<meta name="description" content="" />

</head>



<body>

<h1>代码来源于:<a href="http://www.svnhost.cn" target="_blank">SVN开源社区</a></h1>

 
<script type="text/javascript">

 
<!--

document.writeln(
"  <div id=\"ShowAD\" style=\"position:absolute; z-index: 100;\"> ");

document.writeln(
"    <div id=\"ImgLayer\" style=\"position:absolute; z-index:1; left: 0px;\"> ");

document.writeln(
"      <img src=\"http://www.vzhangmen.com/images/200x130.gif\" width=\"200\" height=\"130\" border=\"0\" usemap=\"#ivrinMap\">");

document.writeln(
"<map name=\"ivrinMap\"><area shape=\"rect\" coords=\"180,0,200,20\" href=\"#\" onclick=\"CloseIVR();return false;\" target=\"_self\"><area shape=\"rect\" coords=\"0,20,200,130\" href=\"http://www.svnhost.cn"+document.domain+"\" target=\"_blank\"></map>");

document.writeln(
"    </div>");

document.writeln(
"</div>");



var bodyfrm = ( document.compatMode.toLowerCase()=="css1compat" ) ? document.documentElement : document.body;

var adst = document.getElementById("ShowAD").style;

adst.top
= ( bodyfrm.clientHeight - 130 ) + "px";

adst.left
= ( bodyfrm.clientWidth - 200 ) + "px";

function moveR() {

    adst.top
= ( bodyfrm.scrollTop + bodyfrm.clientHeight - 130 ) + "px";

    adst.left
= ( bodyfrm.scrollLeft + bodyfrm.clientWidth - 200 ) + "px";

}

setInterval(
"moveR();", 80);

function CloseIVR(){

    adst.display
='none';

}

 
//-->

  </script>

</body>

</html>
posted on 2008-06-09 16:03  YongGe  阅读(506)  评论(0编辑  收藏  举报