Hi,
I’m trying to open a lightbox with an iframe inside. I have this:
functions.php
add_action('wp_footer', 'add_custom_script');
function add_custom_script(){
?>
<script type="text/javascript">
(function($) {
$(window).load(function () {
$(".open-popup-link").magnificPopup({
type: 'iframe',
mainClass: 'avia-popup mfp-zoom-in',
});
});
})(jQuery);
</script>
<?php
}
The link to open the lightbox:
<a href="#open-popup-pass?iframe=true" class="open-popup-link">Open</a>
The lightbox:
<div id="open-popup-pass" class="white-popup mfp-hide">
<iframe id="site" src="url-to-page" style="width: 100%;" />
</div>
Where is the problem?
Hey alnalu!
Thank you for using Enfold.
You’re trying to open a page, inside an iframe, in the lightbox container. I’m sorry but that is not possible. You can only open an external link using the lightbox’s iframe mode or type. Why do you need to place the page inside an iframe?
The code should be:
<a href="http://www.pagehere.com?iframe=true" class="open-popup-link">Open</a>
Regards,
Ismael