易网时代-编程资源站
Welcome
微信登录
首页
/
脚本样式
/
JavaScript
/
JS弹出层单纯的绝对定位居中示例代码
复制代码
代码如下:
function doThis()
{
var a = document.getElementById("addYear");
a.style.left=(document.body.clientWidth/2-a.clientWidth/2)+"px";
a.style.top=(document.body.scrollTop+document.body.clientHeight/2-a.clientHeight/2)+"px";
}
版权所有©石家庄振强科技有限公司2024
冀ICP备08103738号-5
网站地图