Tagged: 

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #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 on mouseover.
    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

    #1328967

    Hey 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,
    Mike

    #1328970

    Thank 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

    #1328972

    Hi,
    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,
    Mike

    #1328975

    no 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.
    #1328991

    Thank 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.

    #1328992

    Thank you @mike!

    #1329002

    Hi,

    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,
    Ismael

    #1329337

    yes – 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 }, )

    #1329415

    Hi,

    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,
    Ismael

    #1329476

    ok – 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.

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.