Hi, i use this solution for a popup window from another post:
Hey axelfx07!
Thank you for using Enfold.
The Enfold uses MagnificPopup as default lightbox plugin. You can add this on functions.php:
function popup_inline() { ?>
<script type=”text/javascript”>
jQuery(window).load(function(){
jQuery(‘.open-popup-link’).magnificPopup({
type:’inline’,
midClick: true // Allow opening popup on middle mouse click. Always set it to true if you don’t provide alternative source in href.
});
});
</script>
<?php }
add_action(‘wp_head’, ‘popup_inline’);
Then use this on a text block:
<div id=”test-popup” class=”white-popup mfp-hide”>
<p>PLACE CONTENT HERE</p>
</div>
Show inline popup
Add this on Quick CSS or custom.css:
.white-popup {
position: relative;
background: #FFF;
padding: 20px;
width: auto;
max-width: 500px;
margin: 20px auto;
}
Remove browser cache then reload the page a few times.
Cheers!
Ismael
It works great, but on my mobile it scrolls automatically to the top on the page and the content of the popup doesn’t shown.
Script is on “360° Tour” button on the bottom of the sidebar. Link ist in private content.
May anybody have a solution to position it on the top of the mobile.
Thank you for helping!
Hey Stefan,
Try adjusting your script to include the overflow callback from this solution to prevent the page from scrolling with magnificPopup lightbox popup.
Best regards,
Mike
Hi, this doesn’t work.
Now i have no popup but it scrolls back on top after klick on button