接上一个浮动广告特效 仅右下角

右下角浮动

 

 

<html>
<head>
<title>网页特效-CSS特效-始终在页面固定位置的层</title>
<meta http-equiv="content-Type" content="text/html;charset=gb2312">
<!--把下面代码加到<head>与</head>之间-->
<style>
<!--
.div{
position: absolute;
border: 2px solid red;
background-color: #EFEFEF;
line-height:90px;
font-size:12px;
z-index:1000;
}
-->
</style>
</head>
<body>
<!--把下面代码加到<body>与</body>之间-->
<div id="Javascript.Div" class="div" style="width: 240; height:90;" align="center">右下...</div>
<SCRIPT LANGUAGE="JavaScript">
function sc1(){
document.getElementById("Javascript.Div").style.top=document.body.scrollTop+document.body.clientHeight-document.getElementById("Javascript.Div").offsetHeight; document.getElementById("Javascript.Div").style.left=document.body.scrollLeft+document.body.clientWidth-document.getElementById("Javascript.Div").offsetWidth;;
}
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!--
function scall(){
sc1();
}
window.onscroll=scall;
window.onresize=scall;
window.onload=scall;
//-->
</SCRIPT>
<div style="position: absolute; top: 0; left: 0; width: 10000; height: 4000;"></div>
</body>
</html>

你可能感兴趣的:(JavaScript,html,css)