让“它”永远停留在最上端

 

让“它”永远停留在最上端

 

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 9.00.8112.16421"></HEAD>
<BODY>
<SCRIPT language=JavaScript>

	window.onscroll=function()
	{
		var mark=document.getElementById("diva");
		mark.style.top=document.body.scrollTop;
	}

</SCRIPT>

<DIV style="POSITION: absolute; BACKGROUND: #0f3; RIGHT: 0px; TOP: 0px" id=diva>我永远在最上面 </DIV>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
<P>hello world</P>
</BODY>
</HTML>
 

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