关于窗口坐标的问题,请教各位达人!
我的程序实现的是一个浮动窗体,内容如下所示,我想把这个东西放到右下角,也就是div的位置放到右下角,不知道坐标怎么设定,谢谢.
<html>
<script language=JavaScript>
speed=20000;
pageheight=0;
function KB_keepItInIE(theName,theWantTop,theWantLeft) {
theRealTop=parseInt(document.body.scrollTop)
theTrueTop=theWantTop+theRealTop
document.all[theName].style.top=theTrueTop
theRealLeft=parseInt(document.body.scrollLeft)
theTrueLeft=theWantLeft+theRealLeft
document.all[theName].style.left=theTrueLeft
}
setInterval( 'KB_keepItInIE( "KBStatic ",0,0) ',1)
</script>
<body>
<SCRIPT>
for(i=100; i <140; i++){
document.write( " ◇◇ "+i+ "◇◇ <br> ")
}
</SCRIPT>
<div id= "KBStatic " style= "position:absolute; left:400px; top:0px; width:553px; height:70px; z-index:25 ">
标题: <select name= "select ">
<option value= "title1 " selected> 标题一 </option>
<option value= "title2 "> 标题二 </option>
<option value= "title3 "> 标题三 </option>
<option value= "title4 "> 标题四 </option>
</select>
<BR/>
字体: <select name= "select ">
<option value= "songti " selected> 宋体 </option>
<option value= "kaiti "> 楷体 </option>
<option value= "heiti "> 黑体 </option>
</select>
</div>
</body>
</html>
另:有哪位达人见过浮动窗口工具类似的东西,指教一下小弟,分可以再补。
------解决方案-------------------- <html>
<script language=JavaScript>
speed=20000;
pageheight=0;
</script>
<body width=100%>
<SCRIPT>
for(i=100; i <140; i++){
document.write( " ◇◇ "+i+ "◇◇ <br> ")
}
</SCRIPT>
<div id= "KBStatic " style= "position:absolute; z-index:25;background:gray; ">
标题: <select name= "select ">
<option value= "title1 " selected> 标题一 </option>
<option value= "title2 "> 标题二 </option>
<option value= "title3 "> 标题三 </option>
<option value= "title4 "> 标题四 </option>
</select>
<BR/>
字体: <select name= "select ">
<option value= "songti " selected> 宋体 </option>
<option value= "kaiti "> 楷体 </option>
<option value= "heiti "> 黑体 </option>
</select>
</div>
<SCRIPT>
var div1=document.getElementById( "KBStatic ");
div1.style.posLeft=document.body.offsetWidth-div1.offsetWidth;