How to open a YouTube Video in the lightbox

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

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)

This topic is marked as "RESOLVED" and can not rceive new replies.