日期:2014-05-17  浏览次数:20643 次

如何用代码设置div滚动条的位置?


------解决方案--------------------
<html>
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 ">
<title> 设置 </title>
</head>
<body>
<div id= "Layer1 " style= "background:gray;width:300px;height:100px;overflow:auto; "> Happy New Year ! ! ! <p>
<input type=button name= 'button_export ' onclick=OpenWord() value=设置>
<p> <p> <p> <p> <p> <p> <br> <P> <p> <p> <p> <p> <p> <p> <p> <p> <p> <p> > <p> <p> <p> <p> <p>
<br> <P> <p> <p> <p> <p> <p> <p> <p> <p> <p> <p>
<p> <p> <p> <p> <p> <br> <P> <p> <p> <p> <p> <p> <p> <p> <p> <p> <p>
<p> <p> <p> <p> <p> <br> <P> <p> <p> <p> <p> <p> <p> <p> <p> <p> <p>
<p> <p> <p> <p> <p> <br> <P> <p> <p> <p> <p> <p> <p> <p> <p> <p> <p>
this is a test!

</div>

<p> this is a test! </p>

</body>
</html>
<script language= "javascript ">
function OpenWord(){
Layer1.style.border=1
Layer1.scrollTop=100;
}
</script>