I'm using a jQuery Lightbox Evolution plugin, and I have photo links inside a iframe. I wanna that Lightbox open outside a iframe, in a parent window.
In the FAQ, i find that I can put some code on parent:
<script type="text/javascript">
function frameload(iframe) {
var doc = iframe.contentWindow || iframe.contentDocument;
if (doc.document) { doc = doc.document; };
$('.lightbox', doc.body).lightbox();
};
</script>
But dont work, because my code is generated inline, dynamic with php. So I dont 'initialize' the plugin in head tag, just call that in the code.
There's my piece of code that initialize the plugin:
echo
'<a style="cursor:pointer;" id="open_'.$emp_alias.'"></a>';
echo
'<script type="text/javascript">
$(document).ready(function(){
$("#open_'.$emp_alias.'").click(function(ev) {
$.lightbox([';
while($images_array = mysql_fetch_assoc($query_emp_images)) {
echo '"/destaques/'.$images_array['path'].'",';
}
echo
']);
ev.preventDefault();
}); });
</script>';
There's a way to load this in the parent window?
Thanks