Hello,
I am having trouble showing an Enfold lightbox popup using a button to show a hidden color section and its contents on the same page.
I created a color section with a button and gave it a Custom ID of “demopop”
I created a second color section and gave it a Custom ID of “demopop” and a Custom CSS class of “mfp-hide”
I added the below code to function php…
function inline_popup_enabler(){
?>
<script>
(function($){
$(window).load(function() {
$(‘.inline_popup’).magnificPopup({
type:’inline’,
midClick: true
});
});
})(jQuery);
</script>
<?php
}
add_action(‘wp_footer’, ‘inline_popup_enabler’);
I’ve seen this work, just not sure how to make it work for me. I setup an admin account for you if you need to get to the page. See private content below.
Thanks for any help you can provide,
Steve
Hey Steve,
Thank you for the inquiry.
The snippet is actually based on a script in this documentation.
// https://dimsemenov.com/plugins/magnific-popup/documentation.html#inline-type
What you need to do is create an element and apply a unique ID to it.
<div id="test-popup" class="white-popup mfp-hide">
Popup content</div>
And a button or a link with the inline_popup class attribute or name, and with the ID of the above element as its href value.
<a href="#test-popup" class="inline_popup">Show inline popup</a>
When the link is clicked, it will open a lightbox container and display the #test-popup content, or the content of the element with the ID test-popup.
Best regards,
Ismael