JS弹出层单纯的绝对定位居中例子代码
发布时间:2023-10-12 15:05:11 所属栏目:教程 来源:
导读:代码如下:
function doThis()
{
var a = document.getElementById("addYear");
a.style.left=(document.body.clientWidth/2-a.clientWidth/2)+"px";
a.style.top=(document.body.scrollTop+docu
function doThis()
{
var a = document.getElementById("addYear");
a.style.left=(document.body.clientWidth/2-a.clientWidth/2)+"px";
a.style.top=(document.body.scrollTop+docu
代码如下: 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"; } (编辑:聊城站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐