Home Forums Porto Template FAQ’s How to open a YouTube Video in the lightbox

This topic contains 0 replies, has 1 voice, and was last updated by  Support 5 years, 2 months ago. This post has been viewed 8287 times

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #1085

    Support
    Keymaster

    Lightbox youtube video example: HTML:

    <a class="popup-youtube" href="http://www.youtube.com/watch?v=0O2aH4XLbto">Open YouTube Video</a>

    Then in the JS (can be in the file js/custom.js) you add a call to the lightbox plugin, like this:

    $(document).ready(function() {
    	$('.popup-youtube').magnificPopup({
    		disableOn: 700,
    		type: 'iframe',
    		mainClass: 'mfp-fade',
    		removalDelay: 160,
    		preloader: false,
    		fixedContentPos: false
    	});
    });

    For more information you can see the plugin documentation: http://dimsemenov.com/plugins/magnific-popup/


Viewing 1 post (of 1 total)