JS弹出层单纯的绝对定位居中示例代码
摘要:复制代码代码如下:functiondoThis(){vara=document.getElementById("addYear");a.st...
复制代码 代码如下:
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";
}
【JS弹出层单纯的绝对定位居中示例代码】相关文章:
★ JavaScript中Number.MIN_VALUE属性的使用示例
上一篇:
jquery的live使用注意事项
下一篇:
JS执行删除前的判断代码