浮动DIV代码大全
<!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.0Transitional//EN">
<HTML>
<HEAD>
<METAhttp-equiv=Content-Typecontent="text/html;charset=gb2312">
<METAcontent="MSHTML6.00.2600.0"name=GENERATOR>
</head>
<body>
<divstyle="height:1000px">
<divid='test'>
mytest
</div>
</div>
<SCRIPTLANGUAGE="JavaScript">
<!--
vardiv=document.getElementById("test")
div.style.position='absolute'
mov()
functionmov()
{
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>
<HTML>
<HEAD>
<METAhttp-equiv=Content-Typecontent="text/html;charset=gb2312">
<METAcontent="MSHTML6.00.2600.0"name=GENERATOR>
</head>
<body>
<divstyle="height:1000px">
<divid='test'>
mytest
</div>
</div>
<SCRIPTLANGUAGE="JavaScript">
<!--
vardiv=document.getElementById("test")
div.style.position='absolute'
mov()
functionmov()
{
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>
本文地址:http://www.45fan.com/a/question/66870.html