16 lines
351 B
JavaScript
16 lines
351 B
JavaScript
class VideoRatio {
|
|
constructor(w) {
|
|
this.window = w
|
|
}
|
|
|
|
init() {
|
|
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
|