Olvide poner mi codigo:
Código HTML:
Ver original<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <script type="text/javascript" language="javascript"> var http_request = false;
function makePOSTRequest(url, parameters, funcion) {
http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
// set type accordingly to anticipated content type
//http_request.overrideMimeType('text/xml');
http_request.overrideMimeType('text/html');
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
alert('Cannot create XMLHTTP instance');
return false;
}
http_request.onreadystatechange = funcion;
http_request.open('POST', url, true);
http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http_request.setRequestHeader("Content-length", parameters.length);
http_request.setRequestHeader("Connection", "close");
http_request.send(parameters);
}
function alertContents() {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
//alert(http_request.responseText);
result = http_request.responseText;
document.getElementById('content').innerHTML = result;
} else {
alert(http_request.status);
}
}
}
function get() {
var poststr = "mes";
makePOSTRequest('fotos.php', poststr, alertContents);
}
function showLightbox() {
document.getElementById('over').style.display='inline';
document.getElementById('fade').style.display='block';
}
function hideLightbox() {
document.getElementById('over').style.display='none';
document.getElementById('fade').style.display='none';
}
body {
background-color: #FFFFFF;
font-family: "Trebuchet MS", Tahoma, Verdana;
font-size: 12px;
font-weight: normal;
color: #666666;
margin: 10px;
padding: 0;
}
.fadebox {
display: none;
position: absolute;
top: 0%;
left: 0%;
width: 100%;
height:100%;
background-color: black;
z-index:1001;
-moz-opacity: 0.8;
opacity:.80;
filter: alpha(opacity=80);
}
.overbox {
display: none;
position: absolute;
top: 0%;
left: 25%;
width: auto;
z-index:1002;
}
#content {
background: #FFFFFF;
border: solid 3px #CCCCCC;
height:auto;
}
<p><a href="javascript:showLightbox();get();">Show LightBox
</a></p> <div id="over" class="overbox"> <a href="javascript:hideLightbox();"<div id="fade" class="fadebox"> </div></a>
La informacion del lightbox se carga con AJAX cuando se aprieba el link
Show Lightbox