Hello @Guenni007
Thank you for mentioning this .. i actually never realized this until now .. the scroll works for a while then it freezes !
can you show me exactly how to do that ? because i am not expert in this :)
Cheers
jQuery(window).load(function(){
jQuery('.open-popup-link').addClass('no-scroll');
jQuery('.open-popup-link').magnificPopup({
type:'inline',
midClick: true,
callbacks: {
beforeOpen: function () {
jQuery('body').css("overflow-y", "hidden");
},
close: function() {
jQuery('body').css("overflow-y", "auto");
},
},
});
});
then it is scrollable on mobile devices – for desctop the scroll of background is hampered – but on mobile you can scroll
@Guenni007
THANK YOU SO MUCH
perfectly working now !
Hi guenni,
i like to try this solution – but where exactly should i put this code in?
In the functions.php of my child-theme? If i do so i get an php error:
Parse error: syntax error, unexpected ‘{‘ in /htdocs/wp-content/themes/enfold-child/functions.php on line 161: jQuery(‘.open-popup-link’).magnificPopup({
Thanks for any help!
Hi,
You can add the code in the functions.php file via the Appearance > Editor panel, or via FTP. We posted the final code below. If you need more help, please feel free to open another thread.
function av_open_inline_popup(){
?>
<script type="text/javascript">
(function($) {
$(window).load(function(){
$('.open-popup-link').addClass('no-scroll');
$('.open-popup-link').magnificPopup({
type:'inline',
midClick: true,
callbacks: {
beforeOpen: function () {
jQuery('body').css("overflow-y", "hidden");
},
close: function() {
jQuery('body').css("overflow-y", "auto");
},
},
});
});
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'av_open_inline_popup');
Best regards,
Ismael