赛车

asp.net(数据库)+jquery实现百度登陆的弹窗效果代码

2019-10-17 03:37:37来源:励志吧0次阅读

asp.net(数据库)+jquery实现百度登陆的弹窗效果代码

asp.net(数据库)+jquery实现百度登陆的弹窗效果代码(附图)

<script>

var gDivLogDocument = null;

function UnLockDocument()

{

if(gDivLogDocument!=null)

{

gDivLogDocument.style.display = "none";

document.body.removeChild(gDivLogDocument);

gDivLogDocument = null;

return;

}

}

function LockDocument(color,bNotAlpha)

{

if(gDivLogDocument!=null)

{

gDivLogDocument.style.display = "";

return;

}

if(bNotAlpha ==null)

{

bNotAlpha = false;

}

gDivLogDocument = document.createElement("DIV");

gDivLogDocument.style.cssText = "position:absolute;zIndex:500;left:0px;top:0px;margin:0 0 0 0 ;background-color:gray;filter:alpha(opacity=60);-moz-opacity:0.6";

gDivLogDocument.oncontextmenu=function()

{

return false;

}

if(bNotAlpha)

{

gDivLogDocument.style.filter = "";

}

if(color !=null)

{

gDivLogDocument.style.backgroundColor = color;

}

gDivLogDocument.style.width = document.body.clientWidth+"px";

var height = Math.max(document.documentElement.scrollHeight,document.documentElement.clientHeight);

gDivLogDocument.style.height =height+"px" ;

document.body.appendChild(gDivLogDocument);

}

function OpenDivWindow(title,iWidth,iHeight,htmlElement)

{

var innerHTML =

" <table width="100%" border="0" cellpadding="0" cellspacing="0"> "+

" <tr> "+

" <td style="padding-left: 3px; color: white; filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr="#A9D1E0", endColorStr="#225289",gradientType="0")"> "+

title+" </td>"+

" <td align="right" style="height: 24px; width: 16px" style="color: white; filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr="#A9D1E0", endColorStr="#225289",gradientType="0")">"+

" <img alt="关闭" style="cursor: pointer" onclick="javascript:CloseDivWindowFromImg(this);" src="../images/close.gif"> </td> "+

" </tr> "+

" </table> ";

var div = document.createElement("DIV");

div.style.cssText="position: absolute; z-index: 502; background-color: White;width="+(iWidth)+"px;height:"+(iHeight+24)+"px;border:solid 1px gray";

div.innerHTML = innerHTML;

if(document.forms.length>0)

{

document.forms[0].appendChild(div);

}else

{

document.body.appendChild(div);

}

div.appendChild(htmlElement);

htmlElement.style.display = "";

CenterObject(div);

return div;

}

function CenterObject(obj)

{

var l = (document.body.offsetWidth - obj.offsetWidth)/2;

var t = (document.documentElement.clientHeight-obj.offsetHeight)/2;

obj.style.left = l+"px";

obj.style.top = t +"px";

}

function CloseDivWindow(div)

{

var innerElement = div.childNodes[1];

if(innerElement)//remove the child element to body

{

innerElement.style.display = "none";

if(document.forms.length>0)

{

document.forms[0].appendChild(innerElement);

}

else

{

document.body.appendChild(innerElement);

}

}

if(document.forms.length>0)

{

document.forms[0].removeChild(div);

}

else

{

document.body.removeChild(div);

}

UnLockDocument();

}

function CloseDivWindowFromImg(img)

{

var div = img.parentNode.parentNode.parentNode.parentNode.parentNode;

CloseDivWindow(div);

}

LockDocument();

OpenDivWindow("标题",400,300,document.getElementById("div1"));

</script>

眉山治疗包皮过长费用
葫芦岛治疗白斑病费用
吐鲁番什么医院治疗白癜风
咸阳白癜风
韶关治疗卵巢炎医院
分享到: