Okay
  Public Ticket #2284735
Hervin Collage photos distorted (square) / deactivate built-in lightbox
Closed

Comments

  • forceWERK started the conversation

    Hello,

    a) suddenly the photos in my Hervin Collage block are distorted (square instead of rectangular) - any ideas how to fix this? https://www.forcewerk.com/portfolio/photography/

    b) Instead of the built-in lightbox I'd like to use the great PhotoSwipe lightbox. In order to don't trigger both lightboxes, I've just renamed the original function Lightbox();  (scripts.js) to LightboxOFF(); - it seams to work, only PhotoSwipe get's triggered. Is there a more elegant solution to don't cause a JavaScript error, because the original Lightbox(); function can't be find anymore?

    Thanks so much - keep up the great work!
    Cheers, Michael

  •  1,810
    Support replied

    Hello,

    1. check to see if the root of the problem is not a plugin you have installed

    2. you can simply comment /* ... */ the part responsible for initializing the collage images to light box (that is elements that have the class .image-link

    $('.image-link').magnificPopup({
      type: 'image',
    mainClass: 'mfp-with-zoom',
    gallery: {
      enabled:true
    },
    zoom: {
    enabled: true,
    duration: 300, 
    easing: 'ease-in-out', 
    opener: function(openerElement) {
    return openerElement.is('img') ? openerElement : openerElement.find('img');
    }
    }
    });


    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  • forceWERK replied

    Hi there,

    1) You were right. It was actually caused by an incompatibility between the plugin a3 lazy load and your theme. I've excluded the photo grid from the plugin in order to fix it.

    (FYI) - https://wordpress.org/support/topic/square-thumbnails-2/

    ---

    I see that you are using a Portfolio – that will be made by the theme or a plugin. When the page loads – lazyload loads a very small square place holder image 16kb in size instead of the image. It then gets the image dimensions and loads the image – if the portfolio developer has code that obsures the image dimensions by adding some script repend the image src then lazyload can’t find either the images or if it can can’t read the image dimensions. If that is the case it will load them as a square image as a ‘best guess’

    Please contact the portfolio developer and ask them to make their portfolio compatible with a3 LazyLoad. They can view all of the lazy load code on the Github repo and reach out ot us there if they need any assistance in doing that

    https://github.com/a3rev/a3-lazy-load

    -
    --
    2) Thank you,  that did the trick!

    Cheers!
    Michael