-
AuthorPosts
-
April 11, 2018 at 11:19 am #940436
Hi
When i open a picture in the lightbox you can scroll the whole page further, so that you can’t see the opend image in the lightbox anymore, like on this page https://ultrapress.de/einstellungen-und-technik/.Is it possible to fix the page while the lightbox is opened?
Thanks
M_AVT- This topic was modified 6 years, 8 months ago by M_AVT.
April 11, 2018 at 11:57 am #940454not to fix the page – but to fix the lightbox with its image.
.mfp-wrap { position: fixed !important }
but look if this works on mobile too – because fixed positioning can be ugly
than use insteadhtml:not(.avia_mobile) .mfp-wrap { position: fixed !important }
April 12, 2018 at 8:18 am #940805Hi Guenni!
Thanks for your help. This works fine, but i still have the problem with the page in the background. I use a fullscreen background image and only the content scrolls, the image is always on the same position. But when i open a image with the lightbox i can’t scroll the content in the background, instead the whole page is scrollable. And when i sroll down the image disappears and i only have a grey background and that looks a bit ugly.
So i thought maybe it is possible to fix the page.
April 12, 2018 at 8:43 am #940809can you show me the link to that?
the magnificPopup event must add the overflow:hidden to html .
hm : just brainstorming…April 12, 2018 at 9:02 am #940814I have installed it lokal, i only can make a screenshot.
When i open the lightbox it cuts the page at the top and at the bottom i have marked it with the red circle https://imgur.com/Aws0Bqa. The cut is always on the ends what is displayed on the screen, before i open the lightbox. When i open the lightbox i can not scroll up only down. And when i scroll further it looks like that https://imgur.com/gLJ3rjh and at the end the whole content is scrolled up and the background is grey.Now i have tested with microsoft edge there is everything normally only the content in the background is scrollable like it should be.
- This reply was modified 6 years, 8 months ago by M_AVT.
April 12, 2018 at 10:08 am #940840a very simple quick and dirty method would be to have a non transparent background ;)
.mfp-zoom-in.mfp-ready.mfp-bg { opacity: 1; }
Did you use a different lightbox plugin ? That would be nice to know
April 12, 2018 at 10:14 am #940841Thanks Guenni, thats a good idea.
April 12, 2018 at 10:18 am #940844but it isn’t that terra messflug at ? This is not enfold
April 12, 2018 at 10:19 am #940845No thats the old page. I set up it new with wordpress and enfold
- This reply was modified 6 years, 8 months ago by M_AVT.
April 12, 2018 at 12:06 pm #940875Hi M_AVT,
I’m not sure if you managed to get your problems solved or not?
Thanks @guenni007 for helping out :-)
Best regards,
RikardApril 12, 2018 at 12:23 pm #940896Hi Rikard!
The problem is existing but with the lightbox background not transparent it isn’ t visible anymore. So that is okay.Best regards
M_AVTApril 12, 2018 at 1:33 pm #940918the magnific popup script sets the html to overflow-y scroll.
that has the reason not at last because otherwise on open the lightbox the background will jump to the right ( the width of the scroll bars)
This looks ugly too.April 12, 2018 at 10:09 pm #941149PS : on his example page this is exactly the behavior – on lightbox open the html goes to overflow-y : hidden
http://dimsemenov.com/plugins/magnific-popup/April 13, 2018 at 4:01 am #941231Hi,
Do let us know if you were able to get this issue sorted.
Thanks, @Guenni007 for helping out :)
Best regards,
VinayApril 13, 2018 at 8:34 am #941333Hi Guenni
Do i need javascript to solve this problem like on the example page you have mentioned.
ThanksApril 13, 2018 at 11:20 am #941413i’m on that topic – but yet i do not know how to have a child theme friendly solution.
I have to read more in the magnific popup api documentation to see if there was a possibility. The code inserted from enfold to html (overflow-y: scroll) is inline code too – on that testpage of Semenovs Testpage is set via css.April 13, 2018 at 11:53 am #941427Hi Guenni!
What do you mean exactly with “the background will jump to the rigth”? I still only have the scrollbar for up and down.April 13, 2018 at 2:09 pm #941505the scrollbars have a given width ( guess something like 17px)
the overflow-y : scroll rule sets scrollbars even if the content fits into screen-height !
Some browsers ( guess safari or the mobile browser ) hide the scrollbars on lightbox open (even if content is bigger than screen-height) if there wasn’t a overflow setting ( or set to auto)April 13, 2018 at 3:21 pm #941546this is only set if enfold detects a masonry and if content height is bigger than window height:
shortcodes.js:
//fix for non aligned elements because of scrollbar if(container.outerHeight() + container.offset().top + $('#footer').outerHeight() > $(window).height()) { $('html').css({'overflow-y':'scroll'}); }
we had to find a different solution for it
April 16, 2018 at 8:17 am #942457Hi Guenni!
This problem which i described is only existing when the content do not fit into screen-height.
April 16, 2018 at 8:47 am #942459yes that is the line above from shortcodes.js and its calculation. it adds that css if window height is smaller than the sum of the other heights
April 18, 2018 at 2:16 am #943327Hi,
This thread might help.
// https://kriesi.at/support/topic/button-link-to-lightbox-webpage-iframe/#post-918245
Best regards,
IsmaelApril 19, 2018 at 11:54 am #944065Hi Ismael!
Thanks for your response. How do i have to change this code wich you have send in this post (https://kriesi.at/support/topic/button-link-to-lightbox-webpage-iframe/#post-918245), because i don’t use a iframe.
Thanks and best regards
M_AVTApril 19, 2018 at 2:03 pm #944096try this: – and please ismael say if there are some faults or upgrades on that code
i tried it first with attr or removeAttr but simple css was in success
but the real hint was to the .mfp-bgadd_action('wp_footer', 'custom_lightbox_script'); 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 }
you don’t need css settings in quick css because it works about css ( inline )
see here in action: https://webers-testseite.de/weber/lightbox/
April 19, 2018 at 3:19 pm #944124i will have a look what happens to pages with no masonry now and with image lightboxes
Edit : works with video lightboxes too ( not the video alb element – but links from images or text to video files
- This reply was modified 6 years, 8 months ago by Guenni007.
April 23, 2018 at 8:17 am #945288Hi Guenni!
Thanks a lot for your help, this code works – the page is not scrollable anymore when i open the lightbox.
Thanks and best regards
April 24, 2018 at 8:16 am #945726Hi,
Awesome! Glad @Guenni007 helped. Please open a new thread if you need anything else. :)
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.