读书人

怎么用代码设置div滚动条的位置

发布时间: 2012-02-20 21:18:24 作者: rapoo

如何用代码设置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>

读书人网 >CSS

热点推荐