Hello Summer Sale!
Exclusive season-opening discount on TheGem theme.
Limited time offer.

Okay
  Public Ticket #2231991
Lightbox video
Closed

Comments

  • Henrique started the conversation

    Hi, how do I use an image and when clicking open the lightbox video (link Youtube)?

  •  5,055
    Michael replied

    HI!

    Please use the YouTube element.

  • Henrique replied

    Hi!

    Youtube element does not open in lightbox

    I want to use an image and by clicking open in lightbox.

    Help me.

  •  5,055
    Michael replied

    Unfortunately, there is no separate element for this.
    But such functionality is present in the portfolio elements.

    https://codex-themes.com/thegem/documentation/#types-of-portfolio-items

    7876830797.png


  • Henrique replied

    OK.

    And how do I open a lightbox video after clicking on the icon?

    Like this page. "Watch video Review" section

    Example: https://codex-themes.com/thegem/gem-cryptocoin/

  •  5,055
    Michael replied

    Please use this code"

    <a class="fancybox" href="javascript"> [gem_icon  centered="1"  pack="userpack" size="large" icon_userpack="e622" color="#ffffff"] </a> 
    <script>
    var ready = (callback) => {
        if (document.readyState != "loading") callback();
        else document.addEventListener("DOMContentLoaded", callback);
    };
    ready(() => {
        var elem = document.querySelector(".fancybox");
        elem.setAttribute('data-fancybox', '');
        elem.setAttribute('data-type', 'iframe');
        elem.setAttribute('data-src', 'https://www.youtube.com/embed/r43LhSUUGTQ');
    });
    </script>
    <style>
    #link {display: none} 
    </style>

     

    8715357936.png