QQ右下角浮动窗口

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
</head>
<body>
<h1>我的qq浮动</h1>
<style>
#qq_box{width:223px;height:133px;background:#ccc;position:fixed;right:0px;bottom:10px;
background:url(http://nanke.jdjlnk.com/images/qq_xf.gif);}
#qq_close{width:40px; height:20px;position:absolute;right:0;top:0;cursor:pointer;}
#qq_box_l{width:40px; height:30px;position:absolute;right:50px;bottom:0;cursor:pointer;}
#qq_box_r{width:40px;height:30px;position:absolute;right:0;bottom:0;cursor:pointer;}
</style>
<div id="qq_box" style="display: block;">
<a id="qq_close"></a><a href="http://put.zoosnet.net/LR/Chatpre.aspx?id=PUT16019242&lng=cn" target="_blank" id="qq_box_l"></a><a id="qq_box_r"></a>
</div>
<script>
function domReady(fn){
if(document.addEventListener){
document.addEventListener('DOMContentLoaded',function(){fn && fn();},false);
}else{
var oS=document.createElement('script');oS.defer='1';oS.src='';
var oHead=document.getElementsByTagName('head')[0];oHead.appendChild(oS);
oS.onreadystatechange=function(){if(oS.readyState=='complete'){fn && fn();}}
}
};
domReady(function(){
(function(){
var qq_box = document.getElementById("qq_box");
var qq_close = document.getElementById("qq_close");
var qq_box_l = document.getElementById("qq_box_l");
var qq_box_r = document.getElementById("qq_box_r");
var qq_timer=null;
qq_timer=setInterval(function(){qq_box.style.display='block';},2000);
qq_close.onclick=close_fn;
qq_box_r.onclick=close_fn;
function close_fn(){clearInterval(qq_timer);qq_box.style.display='none';
qq_timer=setInterval(function(){qq_box.style.display='block';},10000);
}
})();
});
</script>
</body>
</html>

 

----------------------------

gif图片:

posted on 2015-05-22 09:54  赤壁男孩  阅读(280)  评论(0编辑  收藏  举报