Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #765485

    Hey guys,

    I hope you can help me with this. Firsh gives a general instruction for how to make a theme’s lightbox play nice with his great gallery plugin here:

    In most cases, it’s possible to add JIG elements as exceptions regarding what your existing lightbox is used on. However, it might require a little custom coding. It will allow you to use the existing lightbox as a fallback for incidental single pictures, while letting JIG use its own, different lightbox. This is an example of how to prevent the other lightbox from getting opened from clicking JIG thumbnails:
    jQuery(‘a[rel*=”lightbox:not(.justified-image-grid a)”]’).fancybox();

    jQuery(‘a[rel*=”lightbox:not(.justified-image-grid a)”]’).fancybox();
    Or slightly differently:
    jQuery(‘a[rel*=”lightbox”]’).not(‘.justified-image-grid a’).fancybox();

    jQuery(‘a[rel*=”lightbox”]’).not(‘.justified-image-grid a’).fancybox();
    Observe the use of quotes and the difference between :not() and .not() when using jQuery. In this example it’s called fancybox and the selector is based on a rel value, but other scenarios are similar. Change this where the theme applies its lightbox, often in custom.js or main.js found at a location like /wp-content/themes/Avada/js/.
    In certain plugins, such as Responsive Lightbox by dFactory there is a setting for the lightbox selector rel, so just use the core of the solution from above:
    lightbox:not(.justified-image-grid a)

    lightbox:not(.justified-image-grid a)

    Can you give ma a hint on how to achieve that with Enfold’s lightbox? We use Justified Image Gallery for some product galleries, but I would like to keep Enfold’s lightbox for all other images as it is.

    #766929

    Hey Michael,

    Can you give us a link to your website, please. We need some context :)

    Best regards,
    Victoria

    #767350

    Hi Victoria,

    you can see an example of a double lightbox here: http://pfeil-verlag.de/publikationen/die-fruehzeit-der-saurier-in-deutschland/
    (clicking on the thumbnails below the main cover).
    So according to Firsh’s recommendation I would like to exclude the imgaes with rel=”Jig[1]” from the Enfold lightbox.

    Cheers,
    Michael

    #767550

    Hi 0rca,

    Please refer to this thread for a possible solution.

    Just use

    find('img[rel="Jig[1]"]')

    If you need further assistance please let us know.

    Best regards,
    Victoria

    #768035

    Hi Victoria,

    I found it’s even easier to use the selector Firsh recommended, i.e. “.justified-image-grid a”
    and place that under “exclude” in the lightbox activation script in js/avia.js

    (function($)
    	{
    		$.fn.avia_activate_lightbox = function(variables)
    		{
    			
    			var defaults = {
    				groups			:	['.avia-slideshow', '.avia-gallery', '.av-instagram-pics', '.portfolio-preview-image', '.portfolio-preview-content', '.isotope', '.post-entry', '.sidebar', '#main', '.main_menu'], 
    				autolinkElements:   'a.lightbox, a[rel^="prettyPhoto"], a[rel^="lightbox"], a[href$=jpg], a[href$=png], a[href$=gif], a[href$=jpeg], a[href*=".jpg?"], a[href*=".png?"], a[href*=".gif?"], a[href*=".jpeg?"], a[href$=".mov"] , a[href$=".swf"] , a:regex(href, .vimeo\.com/[0-9]) , a[href*="youtube.com/watch"] , a[href*="screenr.com"], a[href*="iframe=true"]',
    				videoElements	: 	'a[href$=".mov"] , a[href$=".swf"] , a:regex(href, .vimeo\.com/[0-9]) , a[href*="youtube.com/watch"] , a[href*="screenr.com"], a[href*="iframe=true"]',
    				exclude			:	'.noLightbox, .noLightbox a, .fakeLightbox, .lightbox-added, a[href*="dropbox.com"], .justified-image-grid a',
    			},

    Is there a way now to do this permanently, i.e. via function php so it survives theme updates?

    #768322

    Hi 0rca,

    Please refer to this reply to see how to do it.

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #768721

    Hi Victoria,

    awesome, this really helps. Thank you very much!

    Cheers,
    MIchael

    #770189

    Hi,

    Glad we could help. :)

    Best regards,
    Nikko

    #1101762

    Hi there,

    for about two years now the recommendation from Orca worked well. After the newest Enfold Update I added “.justified-image-grid a” to the excluded lightboxes, as described. But now I still have double lightboxes.

    See: http://www.powerpress.ch/portfolio/reise/
    What happened or changed?

    Thanks for Your help,
    Dieter

    EDIT: The problem is now solved. I tried a lot but the solution was so simple.

    1) Unchecked the “Lightbox Modal Window” in Theme Options Tab of Child Theme and Save changes.
    2) Do a Cache deletion of Browser
    3) Purge All in Cache Plugin
    4) Check “Lightbox Modal Window” in Theme Options Tab of Child Theme and Save changes.
    5 Now Double Lightboxes should be gone.

    • This reply was modified 5 years, 6 months ago by powerpressdh.
    #1102015

    Hi powerpressdh,

    Great, I’m glad that you got it working and thanks for the update.

    Best regards,
    Rikard

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