码迷,mamicode.com
首页 > 其他好文 > 详细

QQ右下角浮动窗口

时间:2015-05-22 11:07:27      阅读:129      评论:0      收藏:0      [点我收藏+]

标签:

<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图片:技术分享

QQ右下角浮动窗口

标签:

原文地址:http://www.cnblogs.com/cbboys/p/4521552.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!