悬浮窗口

来源:互联网 发布:nature数据库使用华科 编辑:程序博客网 时间:2024/04/29 19:46
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Fixed固定位置的悬浮</title>
<style>
.w { position:absolute; left:10px; bottom:10px; width:200px; height:245px; overflow:hidden; border:2px groove #281; cursor:default; -moz-user-select:none;text-align:center; }
.winBody { height:245px; width:200x; overflow-x:hidden; overflow-y:auto; text-align:center; }
</style>
</head>
<body>
<div class="w">
<div class="winBody">
<img src="1.jpg" width="191" height="191"  />
<p style="font-size:12px;color:red;font-weight:500; text-align:center;">
  扫一扫二维码成为微信会员<br />
  到店送高保真音乐CD一张
</p>
</div>
</div>
</body>
<script>
//代码如下:
new function(w,b,c,d,o){
d=document;b=d.body;o=b.childNodes;c="className";
b.appendChild(w=d.createElement("div"))[c]= "b";
for(var i=0; i<o.length-1; i++)if(o[i][c]!="w")w.appendChild(o[i]),i--;
(window.onresize = function(){
w.style.width = d.documentElement.clientWidth + "px";
w.style.height = d.documentElement.clientHeight + "px";
})();
}
</script>
</html>
原创粉丝点击