<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>设置</title>
</head>
<body onscroll="go()">
<div id="Layer1" style="background:gray;width:300px;height:100px;overflow:auto;position:absolute;">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>
<table width=100% height=900>
<tr><td> </td></tr>
</table>
<p>this is a test!</p>
</body>
</html>
<script language="javascript">
var layer=document.getElementById("Layer1");
layer.style.posLeft=(document.body.clientWidth-layer.offsetWidth)/2;
layer.style.posTop=(document.body.clientHeight-layer.offsetHeight)/2;
function go(){
layer.style.posLeft=(document.body.clientWidth-layer.offsetWidth)/2+document.body.scrollLeft;
layer.style.posTop=(document.body.clientHeight-layer.offsetHeight)/2+document.body.scrollTop;
}
function OpenWord(){
Layer1.style.border=1
Layer1.scrollTop=100;
}
</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>设置</title>
</head>
<body onscroll="go()">
<div id="Layer1" style="background:gray;width:300px;height:100px;overflow:auto;position:absolute;">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>
<table width=100% height=900>
<tr><td> </td></tr>
</table>
<p>this is a test!</p>
</body>
</html>
<script language="javascript">
var layer=document.getElementById("Layer1");
layer.style.posLeft=(document.body.clientWidth-layer.offsetWidth)/2;
layer.style.posTop=(document.body.clientHeight-layer.offsetHeight)/2;
function go(){
layer.style.posLeft=(document.body.clientWidth-layer.offsetWidth)/2+document.body.scrollLeft;
layer.style.posTop=(document.body.clientHeight-layer.offsetHeight)/2+document.body.scrollTop;
}
function OpenWord(){
Layer1.style.border=1
Layer1.scrollTop=100;
}
</script>
解决方案 »
- jquery tree如何获取节点下所有儿子节点,而不是全部节点
- 关于父页面获取子页面数据的问题
- div.onclick = function (){传参数}??
- XDomainRequest对象如何用POST传递变量给PHP?
- 这个javascript问题太奇怪了,请问大家有没有遇到过?
- 请问在.net中,怎样调用js来验证textbox是否有值,并且是信箱
- 请问怎样使IE的下拉条替换成图片???
- 请问table1.children(0).children(i)中的children(0)代表什么意思
- 为什么我的mouseup执行很多次,而且计时器清不掉
- bootstrapTable不能显示本地test.json数据
- 如何让button位于窗口的底部?
- 求一本全面一点,关于正则表达式的书
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>设置</title>
<script type="text/javascript">
<!--
function doLoad(){
var div = document.getElementById("Layer1");
function setTop(){ div.style.top = (document.body.scrollTop + document.body.offsetHeight / 2 - div.offsetHeight / 2) + "px"; }
setTop();
document.body.onscroll = setTop;
window.onresize = setTop;
}
//-->
</script>
</head>
<body onload="doLoad()">
<div id="Layer1" style="background:gray;width:100px;height:100px;overflow:auto;position:absolute;left:0px;"></div>
<script type="text/javascript">
<!--
var i=400;
while(i--){
document.write("<br>");
}
//-->
</script>
</body>
</html>