现在的位置: 首页 > 综合 > 正文

浮动DIV代码

2013年10月17日 ⁄ 综合 ⁄ 共 713字 ⁄ 字号 评论关闭
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
</head>
<body>
<div style="height:1000px">
<div id='test'>
mytest
</div>
</div>
<SCRIPT LANGUAGE="JavaScript">
<!--

var div
=document.getElementById("test")
div.style.position
='absolute'
mov()
function mov()
{
div.style.position
='absolute'
div.style.left
=(100+document.body.scrollLeft).toString()+'px'
div.style.top
=(100+document.body.scrollTop).toString()+'px'
setTimeout(
"mov()",100)
div.innerHTML
='scrollLeft:'+(100+document.body.scrollLeft)+'<br/>'+'scrollHeight:'+(100+document.body.scrollHeight)+'<br/>'
}

-->
</SCRIPT>
</BODY>
</HTML> 

 
 

抱歉!评论已关闭.