javascript设置DIV位置
来源:互联网 发布:cl邀请码淘宝怎么搜 编辑:程序博客网 时间:2024/05/01 15:54
<div id="myDIV" style="z-index: 9999999; position: absolute; display: none; height: 210px;width350px">
<table>
<tr style="height: 25px">
<td class="ModiHead" align="center">
各阶段版本信息</td>
</tr>
<tr style="height: 100%">
<td>
<div style="visibility: inherit; overflow: auto; width: 100%; height: 100%">
<iframe frameborder="0" id="VersionFrame" src="" style="border: 0px; height: 100%;
width: 100%;"></iframe>
</div>
</td>
</tr>
<tr style="height: 25px">
<td class="ModiHead" align="center">
<a style="cursor: hand" onclick="javascript :document.all['myDIV'].style.display='none';">
关 闭</a></td>
</tr>
</table>
/*显示DIV*/
function showDIV()
{
/*获取当前鼠标左键按下后的位置,据此定义DIV显示的位置*/
var leftedge = document.body.clientWidth-event.clientX;
var bottomedge = document.body.clientHeight-event.clientY;
/*如果从鼠标位置到窗口右边的空间小于DIV的宽度,就定位DIV的左坐标(Left)为当前鼠标位置向左一个DIV宽度*/
if (leftedge < myDIV.offsetWidth)
{
myDIV.style.left = document.body.scrollLeft + event.clientX - myDIV.offsetWidth;
}
else
{
/*否则,就定位DIV的左坐标为当前鼠标位置*/
myDIV.style.left = document.body.scrollLeft + event.clientX;
}
/*如果从鼠标位置到窗口下边的空间小于DIV的高度,就定位DIV的上坐标(Top)为当前鼠标位置向上一个DIV高度*/
if (bottomedge < myDIV.offsetHeight)
{
myDIV.style.top = document.body.scrollTop + event.clientY - myDIV.offsetHeight;
}
else
{
/*否则,就定位DIV的上坐标为当前鼠标位置*/
myDIV.style.top = document.body.scrollTop + event.clientY;
}
/*设置DIV可见*/
myDIV.style.display = "block";
return false;
}
- javascript设置DIV位置
- javascript设置DIV位置
- 用Javascript设置DIV的绝对位置
- DIV中滚动条设置到随机位置(CSS+Javascript)
- DIV中滚动条设置到随机位置(CSS+Javascript)
- DIV中滚动条设置到随机位置(CSS+Javascript)
- DIV中滚动条设置到随机位置(CSS+Javascript)
- DIV设置位置居中
- 设置div相对位置
- 设置DIV的绝对位置
- jquery设置获取div位置
- javascript--设置位置
- javascript 设置焦点 光标位置
- 同行div设置其内元素不同位置
- 可编辑DIV设置光标位置
- 显示DIV边框,通过margin设置DIV的位置
- 子DIV设置margin-top影响父DIV位置
- DIV 样式设置和位置定位设置,图片变小手
- 关于linux regulator dirver(1) fixed regulator
- Cocos2d-x 解决闪屏、闪烁问题
- NYOJ 600 花儿朵朵 树状数组
- NSNumber与NSInteger的区别
- what a shame!
- javascript设置DIV位置
- java.lang.OutOfMemoryError: PermGen space
- win7、xp、2k3创建虚拟网卡
- 浅谈网页搜索排序中的投票模型
- IIS的安装配置
- sharepoint webpart 部署、激活
- QSqlDatabase transaction()事物提交
- 获取本机名、本机ip地址。
- 你擅长看日志文件吗?