用div控制其位置
通过screen对象的width和heigth来得到显示器分辨率,然后documentElement.clientWidth还有窗口的位置来确定 真正显示的位置
通过screen对象的width和heigth来得到显示器分辨率,然后documentElement.clientWidth还有窗口的位置来确定 真正显示的位置
解决方案 »
- 和Jquery冲突的代码,求助!急急急
- 使用JS如何得到textarea表单中,用户输入的数据格式不变,保存到数据库中。
- 用javascript 获取基于webkitl浏览器链接网页所有内容
- 继续发帖,div滚动条的问题
- 一个XPATH问题 ▲▲ 如何选择不含某属性的节点?
- 禁止下载js
- 菜鸟问一个时间函数~~~~
- <table>中<tr><td>的style.disabled的问题
- 请教高手我的右键菜单怎么老是被select下拉菜单挡住,而却不会被input框挡住!十万火急!
- 求函数,在一个字符串中查找另一个字符串?
- 模拟 在-->开始-->运行输入\\192.168.1.92回车 的操作
- 把内容打印在浏览器上的最快的方法是什么?
<div style="height:1500px"><img src="http://images.csdn.net/upimgs/CSDN-ad120_360.GIF" width="20" height="60" style="cursor:hand" onclick="display()" /></div><div id="gray" style="position:absolute;width:10px;height:10px;filter:alpha(opacity=35);background-color:black;display:none;z-index:8"></div>
<div id="showbox" style="display:none;position:absolute;z-index:9"><img src="http://images.csdn.net/upimgs/CSDN-ad120_360.GIF" width="120" height="360" /></div>
<script>
function display()
{
var mask=document.getElementById("gray");
var showbox=document.getElementById("showbox");
mask.style.pixelTop=0;
mask.style.pixelLeft=0;
mask.style.width=document.body.clientWidth;
mask.style.height=document.body.clientHeight;
mask.style.display="";
showbox.style.pixelLeft=Math.floor((document.body.clientWidth-120)/2);
showbox.style.pixelTop=Math.floor((document.body.clientHeight-360)/2);
showbox.style.display="";
}
</script>
</body>