Tagged: Lightbox
-
AuthorPosts
-
June 13, 2019 at 10:25 pm #1110132
The only way that I know of to trigger a lighbox display is by clicking on an image within a gallery. My customer wants to display a set of images, each representing a gallery. When the viewer clicks on an image, the gallery will display in a lightbox with auto-rotation. Here is an example of the first page:
When the visitor clicks on “Before and After Stained Kitchen Cabinets” can I make a lightbox appear with a gallery of images that auto-rotate?
June 13, 2019 at 11:32 pm #1110140well maybe it is possible to have that by having your own lightbox activation script:
it is loaded as avia-snippet-lightbox.js – but you can have instead an own child-theme edited script copy.
This could be done by a callback setting like:callbacks: { open: { setInterval(function() { $.magnificPopup.instance.next(); }, 5000); } }
maybe a mod knows how to implement that on the script ;)
June 13, 2019 at 11:49 pm #1110141this is better:
try this in child-theme functions.php:function set_interval_for_lightbox(){ ?> <script> (function($) { setInterval(function() { if(typeof($.magnificPopup.instance) != 'undefined') { $.magnificPopup.instance.next(); } }, 6000); })(jQuery); </script> <?php } add_action('wp_footer', 'set_interval_for_lightbox');
6000 is the interval in milliseconds
but i do not know (yet) how to link directly from the one gallery to a “lightbox gallery slideshow” on the other page.
The code above will work on every sub-page like: http://fvs.768.myftpupload.com/before-after-stained-kitchen-cabinets/June 14, 2019 at 12:56 am #1110144Can the lightbox auto rotate through the images?
June 14, 2019 at 7:24 am #1110220Hi,
There is no functionality for that in the theme unfortunately and I’m not aware of any solutions which would enable that either.
Best regards,
RikardJune 14, 2019 at 7:31 am #1110224try that code please : https://kriesi.at/support/topic/can-i-make-the-lightbox-auto-rotate-and-trigger-with-single-link/#post-1110141
and press one of your images on : http://fvs.768.myftpupload.com/before-after-stained-kitchen-cabinets/
But yor heading tells two requests – the one is the autorotation of a “lightbox slideshow”
the other is to link from your first masonry directly to the lightbox of the other page.for first see here in action: https://webers-testseite.de/gallery/
June 14, 2019 at 8:49 am #1110247for the second request – look into your source code and see what ID the first image got- on that page above it is : #av-masonry-1-item-125
function start_with_clicked_state(){ ?> <script> (function($) { $(window).load(function() { setTimeout(function() { $('#av-masonry-1-item-125').trigger('click'); }, 1000); }); })(jQuery); </script> <?php } add_action('wp_footer', 'start_with_clicked_state');
see here my example page: https://webers-testseite.de/gallery/
with both codes above : after 1sec the lightbox starts – every 6sec the image will load the next one.so you do not have to do something on the starting page: http://fvs.768.myftpupload.com/kitchens/
just see the ID of the first image you have on that newly opend one (http://fvs.768.myftpupload.com/before-after-stained-kitchen-cabinets/)June 14, 2019 at 8:20 pm #1110470the only thing that i can not imagine – is the the autoplay will work for paginated galleries.
if you can show all of your images on one page it will work like here: https://webers-testseite.de/gallery/June 16, 2019 at 9:21 am #1110771Aren’t you willing to accept or try a solution from a non moderator? ;)
if there are questions – tell meJune 16, 2019 at 5:59 pm #1110833Hi bethperkins,
Did you get it working with Guenni007’s suggestions or do you need more help?
Best regards,
VictoriaJune 17, 2019 at 1:56 pm #1111013I’m going to try it today. As I understand, I need to add two functions to my child theme to make this work.
Thanks!
BethJune 17, 2019 at 2:01 pm #1111014Question, will i need to create the second function for every gallery? This sounds overly complex. I’m thinking of using this gallery which sounds like it will do everything I need out of the box. https://enviragallery.com/
June 18, 2019 at 7:51 am #1111204yes – on every gallery you like to start automatically – and you only have to add then analog lines to :
$('#av-masonry-1-item-125').trigger('click');
or change it to (but then all masonry galleries will do the auto start.) :
function start_with_clicked_state(){ ?> <script> (function($) { $(window).load(function() { setTimeout(function() { $('a.av-masonry-entry.lightbox-added:first-of-type').trigger('click'); }, 1000); }); })(jQuery); </script> <?php } add_action('wp_footer', 'start_with_clicked_state');
June 18, 2019 at 8:16 am #1111206some words to that plugin. Seems to be a good one. But:
ask the developer if it is compatible with Enfold – or search the internet for some hints if it is working with enfold.
This plugin – does it work with its own lightbox script. Can you use both lightbox (magnific popup from Dmitry Semenov) and that of your plugin?
Etc pp.;)
https://enviragallery.com/docs/enfold-theme-enviras-automatic-gallery/
June 18, 2019 at 1:43 pm #1111296June 18, 2019 at 9:52 pm #1111498Thank you @guenni007! The function to make the lightbox scroll automatically works great! I’m going to try to convince my customer to start the lightbox by clicking a pic in the gallery instead of the auto link but I’ll try your suggestion is I need to
Thanks for your help!
Beth
June 19, 2019 at 1:08 am #1111511@guenni007! I made progress with your suggestions. Thanks! Another issue with the masonry display and lightbox is that captions are used in the masonry display and the lightbox uses titles. Do you have a workaround for this? I want the lightbox to use the caption entered in the masonry gallery – which sounds obvious
June 20, 2019 at 5:31 pm #1112007Hi bethperkins,
Unfortunately, it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you :)
Best regards,
VictoriaJune 21, 2019 at 11:03 am #1112290can you try this in child-theme functions.php:
function masonry_title_fix(){ ?> <script> (function($){ $(window).load(function() { $('a.av-masonry-entry.lightbox-added').each(function(){ var lin = $(this).find('.av-masonry-entry-content').text(); $(this).attr('title',lin); }); }); })(jQuery); </script> <?php } add_action('wp_footer', 'masonry_title_fix');
but you had to choose to show on the gallery both : title and excerpt (that is the entered Caption)
If you only want to have under the gallery images the title – but on lightbox the caption – just do this to quick css:.av-masonry-entry-content.entry-content { display: none !important; }
see here: https://webers-testseite.de/gallery/
June 21, 2019 at 11:48 pm #1112454@guenni007 Thank you! You’re amazing. Working!
June 22, 2019 at 4:55 am #1112473Hi bethperkins,
Great, I’m glad that you got it working and our big thanks goes out to @guenni007 for helping out. Please let us know if you should need any further help on the topic or if we can close it.
Best regards,
RikardJuly 24, 2019 at 6:18 pm #1121677@guenni007 Thank you for your help modifying the lightbox to autoamtically scroll through images. Works great. Any chance you could help me to make it pause on hover?
July 29, 2019 at 9:04 pm #1122930This doesn’t work for me. I have another thread with this issue. We built many client websites with Enfold using the Masonry Image Gallery Lightbox with captions. All our clients loaded many images into the galleries, added the Caption and not the Titles as the titles were the uploaded image name. All our clients approved the website and they worked great for a time. With the new update, someone decided that Captions (the normal place to add image caption) were not right and they switch everything to Lightbox Titles. Now all the websites we got approvals for and we displaying just find are broken.
Most of these websites are galleries and museums. They don’t have captions now!
Does anyone have a fix that works?
Oh and another thing. If you notice in the Masonry Gallery when you select images, under every image, there is a field to Enter a Caption. If you use this field to enter a caption, IT DOESN’T DISPLAY. So even Enfolds own system doesn’t work since it was switched from displaying caption to titles.
You can see my documentation in my thread here. This issue will become a bigger problem as more users will become aware.
- This reply was modified 5 years, 3 months ago by fulanoinc.
July 30, 2019 at 1:22 am #1122995Hey!
@fulanoinc: We replied in your thread. Please continue there.// https://kriesi.at/support/topic/lightbox-gallery-captions-not-showing/#post-1122994
Regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.