mymaster.js

来自「AjaxMembership示例代码,Membership的使用方法」· JavaScript 代码 · 共 24 行

JS
24
字号
//让对象相对屏幕居中
// SetCtrlToScrCenter(document.all.DetailsView1);
function SetCtrlToScrCenter(obj)
{
    if(obj==null)
    {
        alert('要居中的对象为空!');
        return;
    }
    //obj.style.Z-INDEX = "200";
    //obj.style.POSITION = "absolute";
    var iHeight,iWidth;
    iWidth = 300;
    iHeight = 400;
    if(obj.style.height!='')
        iHeight = obj.style.height;
    if(obj.style.width!='')
        iWidth = obj.style.width;
    //alert(iWidth);
        
    obj.style.top = (document.body.scrollHeight-iHeight)/2;
    obj.style.left = (document.body.offsetWidth-iWidth)/2;
    obj.style.DISPLAY = 'block';
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?