-
AuthorPosts
-
July 4, 2019 at 10:27 am #1115693
i have on one page in different containers image links with lightbox linking – others have a manual link to a Youtube video with iframe=true.
How can I prevent that in the “Lightbox” these two different approaches unite in a gallery?The reason for this is clear – I want to prevent someone who comes into the lightbox via an image from being able to call the youtube video via the next button without having agreed to the GDPR conditions.
Edit: i know if these different links are in different color-sections – there was no gallery mix. But that is not allways possible.
July 6, 2019 at 12:10 pm #1116241Hey Guenter,
You can add a different class to the galley and init lightbox for this class separately.
Maybe something like this
https://kriesi.at/support/topic/how-to-invoke-lightbox-from-image-but-show-different-content-in-lightbox/#post-361096Best regards,
VictoriaJuly 6, 2019 at 10:31 pm #1116343But how to influence ( hook to ) the enfold lightboxes – not the inline popups.
by the way – you see the link in private content. This is no gallery from the start. There are on that page different media files which have all a lightbox link.
The default enfold way on the alb to have lightbox.
I want to avoid that all media files are part of the “gallery” in the lightbox by clicking the next (or prev.) Button. On default Enfold behavior it is different Media files in different color-section are not part of one lightbox gallery.So is there a way to split in a layout without color-sections f.e. videos in one lightbox – images in the other?
July 7, 2019 at 10:16 am #1116392Hi Guenni007,
I meant something like this.
https://kriesi.at/support/topic/triggering-lightbox-gallery-with-link/Well, you’ll need to add separate groups to every image element.
Best regards,
VictoriaJuly 7, 2019 at 11:58 pm #1116515thanks for the hint :
my solution now is ( because the youtube links : images with link to youtube films with iframe=true) have on lightbox-added the additional class: mfp-iframe i can do it this way:
1) i gave the data-group to lightbox-added – then to mfp-iframe – so they got different data-groups
2) and i had to add the main-class to magnific popup uses on enfold case to work properly
3) i have to do it with window load not document ready// custom lightbox function add_custom_script_lightbox(){ ?> <script> (function($){ $(window).load(function() { $('.lightbox-added').attr('data-group', '1'); $('.mfp-iframe').attr('data-group', '2'); var groups = {}; $('.lightbox-added').each(function() { var id = parseInt($(this).attr('data-group'), 10); if(!groups[id]) { groups[id] = []; } groups[id].push( this ); }); $.each(groups, function() { $(this).magnificPopup({ type: 'image', mainClass: 'avia-popup mfp-zoom-in mfp-image-loaded', closeOnContentClick: false, closeBtnInside: false, gallery: { enabled:true } }) }); }); })(jQuery); </script> <?php } add_action('wp_footer', 'add_custom_script_lightbox');
July 9, 2019 at 5:16 pm #1117101Hi Guenni007,
Thank you for sharing!
Glad you got it working for you! :)
If you need further assistance please let us know.
Best regards,
VictoriaJuly 12, 2019 at 8:38 pm #1118177no you can close it now
July 12, 2019 at 9:27 pm #1118204Hi Guenni007,
Hope the solution will serve future generations :)
Best regards,
Victoria- This reply was modified 5 years, 4 months ago by Victoria.
-
AuthorPosts
- The topic ‘lightbox galleries’ is closed to new replies.