Click here to Skip to main content
15,890,186 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to Open Simple Popup Window using Jquey
Please Help
Posted
Comments
CodeBlack 12-Sep-13 7:26am    
what do you want to display in popup window ? only message or some html with Input tags ?
Balkrishna Patel 12-Sep-13 8:48am    
only message or some html with input tags

 
Share this answer
 
I got it !!!!!!!!!!!!!!


Quote:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Simple Jquery Popup Demo</title>
<script src="http://code.jquery.com/jquery-1.8.2.min.js" type="text/javascript" ></script>

<script type="text/javascript">

function OpenPopup(id) {

var winHeight = $(document).height();
var winWidth = $(document).width();

var divHeight = $("#" + id).height();
var divWidth = $("#" + id).width();

$("#" + id).css({
"position": "absolute",
"top": winHeight / 2 - divHeight / 2,
"left": winWidth / 2 - divWidth / 2
});

//only need force for IE6
$("#" + id + "_background").css({
"height": winHeight,
"width": winWidth,
"opacity": "0.7"
});

$("#" + id + "_background").fadeIn("slow");
$("#" + id).fadeIn("slow");

// get rid on popup
$("#" + id).attr("popup", "1");

$("#" + id + "_background").click(function () {
ClosePopup(id, false);
});
}

function ClosePopup(id,force) {

if (force == false) {
var value = $("#" + id).attr("popup");
if (value == null || value != "1")
return;
}

$("#" + id + "_background").fadeOut("slow");
$("#" + id).fadeOut("slow");
$("#" + id).attr("popup", "0");
}
</script>

<style type="text/css">
.popup
{
display:none;
position:fixed;
_position:absolute; /* hack for internet explorer 6*/
background:#FFFFFF;
border:2px solid #cecece;
z-index:101;
padding:12px;
font-size:13px;
color : #000000;
}

.popup_overlay
{
display:none;
position:fixed;
_position:absolute; /* hack for internet explorer 6*/
height:100%;
width:100%;
top:0;
left:0;
background:#000000;
border:1px solid #cecece;
z-index:100;
}

.popup_close
{
font-size:14px;
line-height:14px;
right:6px;
top:4px;
position:absolute;
color:#3e4685;
font-weight:700;
display:block;
}

.popup a
{
cursor: pointer;
text-decoration:none;
}

.popup span
{
color:#3e4685;
font-size:22px;
font-weight:700;
border-bottom:1px dotted #D3D3D3;
padding-bottom:2px;
margin-bottom:20px;
}
</style>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900