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