Friday, August 5, 2011

Showing a PopUp window using Javascript and Div tag


<div id="popup_page" style="border: 1px;position:fixed; background-position:center; top: 15%; left: 20%;border:1px solid #000;z-index: 69; border-style: solid;width: 600px; height: 400px;display:none;background-color: #E2EAFF;" runat="server">






Login


</div>
function OpenQuestionModelPopup(fld) {

try {
var pnlSecurtityQues = document.getElementById(fld);
var height = window.innerHeight;
var width = window.innerWidth;

if (pnlSecurtityQues) {
pnlSecurtityQues.style.display = "block";
pnlSecurtityQues.style.left = (width - 800) / 2 - (pnlSecurtityQues.style.width / 2) + "px";
pnlSecurtityQues.style.position = "fixed";
pnlSecurtityQues.style.top = (height - 400) / 2 - (pnlSecurtityQues.style.height / 2) + "px";
pnlSecurtityQues.style.zIndex = 11;
}
return false;
}
catch (e) {
}
}

No comments:

Post a Comment