deblan.io-murph/assets/js/app/video-ratio.js
2021-06-15 14:26:38 +02:00

14 lines
332 B
JavaScript

const VideoRatio = function (w) {
this.window = w
}
VideoRatio.prototype.init = function () {
const videos = this.window.document.querySelectorAll('.video-ratio')
for (let i = 0, len = videos.length; i < len; i++) {
videos[i].style.paddingBottom = videos[i].getAttribute('data-ratio')
}
}
module.exports = VideoRatio