Started on documentation and aspect ratio option

This commit is contained in:
Sam Potts
2017-11-06 19:38:31 +11:00
parent 5fe477340b
commit 0068710740
14 changed files with 159 additions and 108 deletions

View File

@ -17,6 +17,10 @@ const youtube = {
// Add embed class for responsive
utils.toggleClass(this.elements.wrapper, this.config.classNames.embed, true);
// Set aspect ratio
const ratio = this.config.ratio.split(':');
this.elements.wrapper.style.paddingBottom = `${100 / ratio[0] * ratio[1]}%`;
// Set ID
this.media.setAttribute('id', utils.generateId(this.type));