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>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)