EduardET

Youtube/vimeo popup videos

Jan 12th, 2018
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2. ( function( $ ) {
  3.     $( document ).ready( function() {
  4.         if ( $( '.popup-youtube' ).length ) {
  5.             $( '.popup-youtube' ).magnificPopup( {
  6.                 type: 'iframe',
  7.  
  8.  
  9.                 iframe: {
  10.                     markup: '<div class="mfp-iframe-scaler">' +
  11.                         '<div class="mfp-close"></div>' +
  12.                         '<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>' +
  13.                         '<div class="mfp-title">Some caption</div>' +
  14.                         '</div>'
  15.                 },
  16.                 callbacks: {
  17.                     markupParse: function( template, values, item ) {
  18.                         values.title = item.el.attr( 'title' );
  19.                     }
  20.                 }
  21.  
  22.  
  23.             } );
  24.         }
  25.     } );
  26. } )( jQuery );
  27. </script>
Advertisement
Add Comment
Please, Sign In to add comment