Page Text: HubSpot CMS
Video Gallary with popup
Video gallery really enhances the rating of your site when people search for related topics and videos whether on Youtube and Vimeo or search engines in general. Getting your Youtube, Vimeo extension working is straightforward with a few simple steps required to build these great video resources on your Hubspot site. The process of creating a video gallery only takes a few minutes and created gallery can be displayed on any page or post of HubSpot shortcode and no matter how small your device screens are it will automatically adjust to fit on that screens and display perfectly. With the drag and drop image position feature, you can arrange the order of the image that has to be displayed in your gallery.
?
After receiving a minimum of 25 recommendations, an entry earns the "Community Approved" badge.
Please keep in mind, all entries are community created and may not be fully supported by HubSpot.
5 Recommendations
VIEW LIVE DEMO
HTML + HUBL
CSS
.vd__Wrap { display: block; width: 100%; max-width: 1260px; margin: 30px auto; } .vd__Section { display: inline-block; text-align: center; width: 100%; margin: 20px 0; } .video_Cover { display: inline-block; width: 100%; box-shadow: 0px 0px 20px 0px rgba(12, 11, 11, 0.5); -moz-box-shadow: 0px 0px 20px 0px rgba(12, 11, 11, 0.5); -webkit-box-shadow: 0px 0px 20px 0px rgba(12, 11, 11, 0.5); background-position: right bottom; position: relative; } .video_thumb img { width: 100%; } .video_Cover .play_icn.video { width: 66px; height: 48px; text-align: center; display: inline-block; background: #007AAC; position: absolute; left: 0; bottom: 0; } .video_Cover .play_icn.video img { vertical-align: middle; border-style: none; margin-top: 12px; width: 20px; } .play_icn:hover { background:#202125 !important; } .col__1V, .col__2V, .col__3V { display: inline-block; width: 45%; margin: 15px 2%; } .col__1V { width: 50%; } .col__3V { width: 29%; } @media only screen and (max-width: 1023px) { .col__1V { width: 70%; } .col__3V { width: 45%; } } @media only screen and (max-width: 767px) { .col__2V, .col__3V { width: 70%; } } @media only screen and (max-width: 600px) { .col__1V, .col__2V, .col__3V { width: 100%; margin: 15px 0; } .vd__Wrap { width: 94%; } }
JS
jQuery(document).ready(function() { setTimeout(function() { jQuery('.popup-gallery').magnificPopup({ delegate: 'a', type: 'image', callbacks: { elementParse: function(item) { // Function will fire for each target element // "item.el" is a target DOM element (if present) // "item.src" is a source that you may modify console.log(item.el.context.classList[0]); if(item.el.context.classList[0] == 'video') { item.type = 'iframe', item.iframe = { patterns: { youtube: { index: 'youtube.com/', // String that detects type of video (in this case YouTube). Simply via url.indexOf(index). id: 'v=', // String that splits URL in a two parts, second part should be %id% // Or null - full URL will be returned // Or a function that should return %id%, for example: // id: function(url) { return 'parsed id'; } src: '//www.youtube.com/embed/%id%?autoplay=1&rel=0', // URL that will be set as a source for iframe. }, vimeo: { index: 'vimeo.com/', id: '/', src: '//player.vimeo.com/video/%id%?autoplay=1' }, gmaps: { index: '//maps.google.', src: '%id%&output=embed' } } } } else { item.type = 'image', item.tLoading = 'Loading image #%curr%...', item.mainClass = 'mfp-img-mobile', item.image = { tError: '
The image #%curr% could not be loaded.' } } } }, gallery: { enabled: true, navigateByImgClick: true, preload: [0,1] // Will preload 0 - before current, and 1 after the current image }, }); }, 1200 ); });
ADDITIONAL FILES