Image Block Lightbox Caption v2

Description:

Image block lightbox caption 1

#1. Install Code

Use code to Code Injection > Footer (or Individual Page Header Injection)

  • If you use Personal/Basic Plan and your plan doesn’t support Injection, you can also add a Markdown Block under Image Block > then paste same code.
<!-- @tuanphan - Image Block Lightbox Caption v2 -->
<style>
  :root {
    --lightbox-overlay-color: rgba(255, 255, 255, 0.9);
    --lightbox-padding: 4vw;
    --lightbox-gap: 24px;
    --lightbox-close-top: 16px;
    --lightbox-close-right: 16px;
    --lightbox-image-max-width: 65vw;
    --lightbox-image-max-height: 86vh;
    --lightbox-caption-font-size: 13px;
    --lightbox-caption-color: #000;
    --lightbox-caption-line-height: 1.5;
    --lightbox-caption-max-width: 27vw;
    --lightbox-close-size: 36px;
    --lightbox-close-font-size: 28px;
    --lightbox-mobile-image-width: 88vw;
    --lightbox-mobile-image-height: 60vh;
    --lightbox-mobile-caption-width: 88vw;
  }
</style>
<script src="https://code.beaverhero.com/test/imageblock/501v3imgblocklightboxcaptionv2.js"></script>

 

Image block lightbox caption 2

#2. Usage

Edit Image > Enable Lightbox

Image block lightbox caption 3

Add Caption text via ALT field

Image block lightbox caption 4

#3. Customize

All style options here

Image block lightbox caption 5

#3.1. To change overlay color behind Image Lightbox

--lightbox-overlay-color: rgba(255, 255, 255, 0.9);

#3.2. To change close X icon size

--lightbox-close-font-size: 28px;

#3.3. To change caption text style

--lightbox-caption-font-size: 13px;
--lightbox-caption-color: #000;
--lightbox-caption-line-height: 1.5;
--lightbox-caption-max-width: 27vw;

#3.4. To make caption under image

Image block lightbox caption 7

use this code to Custom CSS

/* caption under image */
.tp-lb-box {
    flex-direction: column;
}

Image block lightbox caption 6

#3.5. To align text-image like this.

Image block lightbox caption 8

You can use this code to Custom CSS

/* align image text */
.tp-lb-caption {
    text-align: left !important;
    max-width: 100% !important;
}
.tp-lb-box {
    align-items: flex-start;
    flex-direction: column;
      margin-bottom: 30px;
}

Image block lightbox caption 9

Buy me a coffee