Tagged: gallery
-
AuthorPosts
-
November 12, 2021 at 9:27 pm #1328823
Hello:
I am using the image gallery ALB element configured for Big image with thumbnails below and was wondering if there’s a way for the thumbnails to swap out the main image only
onclick
, as opposed to onmouseover
.
I did some user testing and users were quite confused by the behaviour because the onclick just opens the lightbox rather than showing them the preview of that image in the big image space. Their expectation was that you click the thumbnail to see the big image as preview, and click the big image to open the image itself.
How might I go about adjusting this behaviour?Thank you
November 14, 2021 at 8:05 pm #1328967Hey ilowelife,
Thank you for your patience the file that controls this is\wp-content\themes\enfold\config-templatebuilder\avia-shortcodes\gallery\gallery.js
and I did some testing but while the thumbnail mouseover behavior can be changed to click this also affects the behavior of the rest of the element and breaks large image popup because of how the script is written, unfortunately it would require a rewrite that is more than we can offer here.
If you really want this customization, we can recommend Codeable for their experience and expertise with Enfold. Please follow the link to discuss your project and time frame with them.Best regards,
MikeNovember 14, 2021 at 8:25 pm #1328970Thank you Mike:
Is there still a specific thread for feature requests? The support forum has become a bit hard to navigate over the years ;-)
I ask because I think this should be a configurable option in the future so I want to suggest that. I am uncomfortable in general with the notion of forking Enfold (even with professional help), and keep hoping that future updates could add extended options to many of the existing elements which are now only available through child theme overrides.
Cheers,
Iain
November 14, 2021 at 8:42 pm #1328972Hi,
I have submitted this request to the Dev Team for their review, perhaps in the future it will be added as an option, thank you for using Enfold.Best regards,
MikeNovember 14, 2021 at 9:24 pm #1328975no my solution is only a temporary solution – because it does not have a gallery function in the lightbox.
https://webers-testseite.de/ajax-gallery/- This reply was modified 3 years ago by Guenni007.
November 15, 2021 at 1:43 am #1328991Thank you @Guenni007.
This is close, but not quite what I am hoping for.. as you note, I don’t have the lightbox gallery there. It’s clever though. I am not really a coder and admire anyone that can extend this kind of thing.
November 15, 2021 at 1:43 am #1328992Thank you @mike!
November 15, 2021 at 3:33 am #1329002Hi,
Thank you for your patience.
While the devs are working on a solution, try to edit the gallery element and set the Advanced > Link Settings > Image Link settings to the last option (no links) to disable the links completely. We will also have to modify the enfold/config-templatebuilder/avia-shortcodes/gallery/gallery.js file directly to replace mouse hover with click. Look for this code around line 33..
gallery.on('mouseenter','.avia-gallery-thumb a', function()
,.. and replace it with.
gallery.on('click','.avia-gallery-thumb a', function()
After that, add this code in the functions.php file to re-enable the lightbox for the gallery.
function av_popup_gallery(){ ?> <script type="text/javascript"> (function($) { $(document).ready(function(){ $('.avia-gallery-big').removeClass('noLightbox avianolink fakeLightbox'); $('.avia-gallery-big').magnificPopup({ image: { markup: '<div class="mfp-figure">'+ '<div class="mfp-close"></div>'+ '<div class="mfp-img"></div>'+ '<div class="mfp-bottom-bar">'+ '<div class="mfp-title"></div>'+ '<div class="mfp-counter"></div>'+ '</div>'+ '</div>', // Popup HTML markup. <code>.mfp-img</code> div will be replaced with img tag, <code>.mfp-close</code> by close button cursor: 'mfp-zoom-out-cur', // Class that adds zoom cursor, will be added to body. Set to null to disable zoom out cursor. titleSrc: 'title', // Attribute of the target element that contains caption for the slide. // Or the function that should return the title. For example: // titleSrc: function(item) { // return item.el.attr('title') + '<small>by Marsel Van Oosten</small>'; // } verticalFit: true, // Fits image in area vertically tError: '<a href="%url%">The image</a> could not be loaded.' // Error message } }); }); })(jQuery); </script> <?php } add_action('wp_footer', 'av_popup_gallery');
Please do not forget to toggle or temporarily disable the Enfold > Performance > File Compression settings after doing the steps above.
Best regards,
IsmaelNovember 17, 2021 at 12:40 pm #1329337yes – that is nearly exactly my solution – only that change in gallery.js i think it is not necessary.
– but it has the disadvantage ( as mentioned above ) – that there is no “gallery mode” ( on magnificPopup: gallery: { enabled:true }, )November 18, 2021 at 4:50 am #1329415Hi,
Thank you for the info @Guenni007.
The user wanted the big thumbnail to change on click instead of hover or mouseover, so the changes in the gallery.js file may still be necessary
Best regards,
IsmaelNovember 18, 2021 at 11:12 am #1329476ok – sorry, then I misunderstood him.
I thought he just didn’t want the lightbox to open when clicking the thumbnails.
So only the large image should be shown when clicking the thumbnails. -
AuthorPosts
- You must be logged in to reply to this topic.