<script language="javascript">
function switchSpan(spanId)
{
if(document.all[spanId].style.visibility=="visible")
document.all[spanId].style.visibility="hidden";
else
document.all[spanId].style.visibility="visible";document.all[spanId].style.left=document.body.clientWidth/2+document.body.scrollLeft;
document.all[spanId].style.top=document.body.clientHeight/2+document.body.scrollTop;
/*
因为两个按钮之间相隔超过一屏,怎样设置div在屏幕的中央,
如果层拖动改变的位置,怎样雇这个位置?
*/
}
</script>
<input type="button" value="发贴" onclick='switchSpan("post")' ID="Button2" NAME="Button2">
<p>ballack<p>ballack<p>ballack<p>ballack<p>ballack<p>ballack
<p>ballack<p>ballack<p>ballack<p>ballack<p>ballack<p>ballack
<input type="button" value="发贴" onclick='switchSpan("post")' ID="Button3" NAME="Button3">
<div id=post style="position:absolute">发贴<input name=mytext></div>
function switchSpan(spanId)
{
if(document.all[spanId].style.visibility=="visible")
document.all[spanId].style.visibility="hidden";
else
document.all[spanId].style.visibility="visible";document.all[spanId].style.left=document.body.clientWidth/2+document.body.scrollLeft;
document.all[spanId].style.top=document.body.clientHeight/2+document.body.scrollTop;
/*
因为两个按钮之间相隔超过一屏,怎样设置div在屏幕的中央,
如果层拖动改变的位置,怎样雇这个位置?
*/
}
</script>
<input type="button" value="发贴" onclick='switchSpan("post")' ID="Button2" NAME="Button2">
<p>ballack<p>ballack<p>ballack<p>ballack<p>ballack<p>ballack
<p>ballack<p>ballack<p>ballack<p>ballack<p>ballack<p>ballack
<input type="button" value="发贴" onclick='switchSpan("post")' ID="Button3" NAME="Button3">
<div id=post style="position:absolute">发贴<input name=mytext></div>
解决方案 »
- jquery 在IE中运行不了,在其他浏览器中正常
- iframe 的怪问题
- 我写了一个 用JS实现几秒钟自动转到另一个页面的程序,但有点问题??请教
- 利用“javascript” 和 “CSS” 修改 “网页布局”的问题
- 图片的选择和大小合并
- 请问如何周期性的读取js文件?谢谢您
- 请问innerHTML怎样可以实现javascript的src的效果?
- 急,请问如何用正则表达式检查一个输入值,输入值可以为负数,0,正数,小数点后面可以最多有四位?
- 关于用JS验证日期的问题
- 怎样设置连接!
- 如何做首页弹出很大的广告条,过几秒后自动消失?
- 怎么跟踪table键?????????????????????????
<DIV ID="oDiv"
STYLE="background-color: #CFCFCF; position: absolute;
left:expression(document.body.clientWidth/2-oDiv.offsetWidth/2);
top:expression(((document.body.clientHeight/2-oDiv.offsetHeight/2)<0)?0:(document.body.clientHeight/2-oDiv.offsetHeight/2))">
<input type="button" value="发贴" onclick='switchSpan("post")' ID="Button2" NAME="Button2">
两按钮之间相隔超过一屏
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>><br><br><br><br><br><br><br><br><br><br><br>><br><br><br><br><br><br><br><br><br><br><br>
。
。
<input type="button" value="发贴" onclick='switchSpan("post")' ID="Button3" NAME="Button3"></DIV>