13,525
edits
No edit summary |
No edit summary |
||
Line 21: | Line 21: | ||
var onlyVideos = videos.length == boxes.length ? true : false; | var onlyVideos = videos.length == boxes.length ? true : false; | ||
videos.each(function(ii, video) { | videos.each(function(ii, video) { | ||
if ( | if (onlyVideos) | ||
$(video).css(' | $(video).css('height', 'auto'); | ||
$(video).parent().css( | $(video).parent().css('max-width', 'calc(100% - 30px)'); | ||
}); | }); | ||
var timeOut = onlyVideos ? | var timeOut = onlyVideos ? 1000 : 0; | ||
setTimeout(function() { | setTimeout(function() { | ||
var height = 0; | var height = 0; | ||
Line 34: | Line 34: | ||
videos.each(function(ii, video) { | videos.each(function(ii, video) { | ||
maxHeight = height - 30; | maxHeight = height - 30; | ||
$(video).parent().parent().css({'height': height, 'display': 'flex'}); | $(video).parent().parent().css({'height': height, 'display': 'flex'}); | ||
$(video).parent().css({'width': '100%', 'min-width': '125px', 'margin': 'auto'}); | |||
$(video).css({'height': 'auto', 'max-height': maxHeight}); | |||
}); | }); | ||
}, timeOut); | }, timeOut); |