-
AuthorPosts
-
June 26, 2022 at 9:59 am #1356517
What has changed in Enfold 5?
on previous versions of Enfold I think it was that when the lightbox was open it was fixed, and only the body could still scroll.
This is not the best behavior, a fixed body with the lightbox open would be best.
But now we have scrolling for the lightbox container as well? Is there a reason for this?
Open an image and scroll with your mouse:
https://kriesi.at/themes/enfold-parallax/#portfolio
PS:
Looking at the old Enfold demos, I guess my assertion is not true. But wouldn’t that be a desirable behavior of the lightbox?yes i can put this to child-theme functions.php to have that:
function custom_lightbox_script(){ ?> <script type="text/javascript"> (function($) { function a() { $('body').on('click', '.lightbox-added', function() { if($('.mfp-bg').length >= 1) { $('html').css("overflow-y", "hidden"); } }); $('body').on('click', function() { setTimeout( function() { if($('.mfp-bg').length == 0) { $('html').css("overflow-y", "scroll"); } },500); }); } a(); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_lightbox_script');
but i think some settings on the lightbox options will be more performant
fixedBgPos true/false
overflowY auto / scroll / hiddenJune 27, 2022 at 7:54 am #1356578Hey Guenter,
Thank you for the inquiry.
We are not seeing any difference with the lightbox in the 2017 and the parallax demo. Would you mind providing a screenshot?
We checked the lightbox in the following demo pages.
// https://kriesi.at/themes/enfold-parallax/#portfolio
// https://kriesi.at/themes/enfold-2017/portfolio-item/imac-revolution/Are you trying to disable scrolling when lightbox is opened? There seems to be no dedicated option for it based on the documentation.
// https://dimsemenov.com/plugins/magnific-popup/documentation.html
Best regards,
IsmaelJune 27, 2022 at 1:19 pm #1356598yes – and the script is something i wrote in former enfold versions to have that behavior. No scroll on the background as long as the lightbox is opened.
But for a while i do not need to insert that code above to have that – and i thought it is due to enfold got this as the normal behavior. But now i see on new demo that now i can scroll even the lightbox out of sight ( with the background )there is the possiblity to set in the callback :
callbacks: { beforeOpen: function () { $('html').css("overflow-y", "hidden"); }, close: function() { $('html').css("overflow-y", "auto"); }, },
that will do the job too.
And very strange on that page here: https://enfold.webers-webdesign.de/#portfolio i wrote a custom magnificPopup script to change some settings ( animations ) but not these overflow-y thing from above.
Only doing this the html styles are set. And you see that trying to scroll the background or the lightbox container does not work.but when i look to the js/avia-popup/jquery.magnific.popup.js file there are a lot of hints concerning to : fixedContentPos – and i thought that for a while this was default behavior.
June 29, 2022 at 2:44 pm #1356860Hi,
if you check enfold\js\avia-snippet-lightbox.js line 21:
fixedContentPos: false, // allows scrolling when lightbox is open but also removes any jumping because of scrollbar removal
Changeing this to true will do it.
There was probably a reason why it was added.As far as I know there was no request up to now – so I would suggest to add a filter to activate this.
Edit:
added: filter ‘avf_default_lightbox_no_scroll’ – block default lightbox and body from scroll
return anything except false (e.g. true) in filter
Best regards,
Günter- This reply was modified 2 years, 5 months ago by Günter.
June 30, 2022 at 10:42 am #1356923Thank you for responding to the needs of fewer participants here as well. ;)
-
AuthorPosts
- You must be logged in to reply to this topic.