-
AuthorPosts
-
January 19, 2021 at 10:37 pm #1273843
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
January 20, 2021 at 12:39 am #1273857jQuery(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
January 20, 2021 at 4:57 pm #1274115@Guenni007
THANK YOU SO MUCH
perfectly working now !July 1, 2021 at 11:20 am #1308293Hi 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!July 2, 2021 at 6:05 am #1308464Hi,
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 -
AuthorPosts
- The topic ‘Lightbox’ is closed to new replies.
