<!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>利用DIV+CSS制作浮动广告,没有用到多少javascript,全是css</title>
</head>
<body>
<div style="height:1500px;background:#f0f0f0;"></div>
<div id="qqobjbox" class="qqobjbox" style="display:block;" οnmοusemοve="qqboxove('qqobjbox');" οnmοuseοut="qqboxout('qqobjbox');">
qqbox
</div>
<style>
.qqobjbox,.qqobjboxove,.qqobjboxout {width:100px;height:80px;position:fixed !important;top:0;position:absolute;z-index:100;background:red;float:right;}
*html .qqobjbox,*html .qqobjboxove,*html .qqobjboxout {top:expression(offsetParent.scrollTop+20);}
.qqobjbox {left:-80px;}
.qqobjboxove {left:0px;}
.qqobjboxout {left:-80px;}
</style>
<script>
function qqboxove(str){document.getElementById(str).className="qqobjboxove";}
function qqboxout(str){document.getElementById(str).className="qqobjboxout";}
</script>
</body>
</html>