javascript 浮动窗口 简要代码

< !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 >120 </title>
< script language ="JavaScript" type ="text/javascript" >
window.onscroll = function(){
  var ast_vido = document.getElementById("ast_vido").style;
  de = document.documentElement;
  ast_vido.pixelTop    = de.scrollTop+de.clientHeight-ast_vido.pixelHeight;
  ast_vido.pixelLeft = de.clientWidth-ast_vido.pixelWidth;
}
</script>
</head>

< body style ="height:9000px;" >
< div id ="ast_vido" style ="position:absolute;width:400px;height:300px;background-color:#000000;" > </div>
</body>
</html>

你可能感兴趣的:(JavaScript,脚本,浮动)