Library to adjust iFrame aspect-ratios reponsively, written in TypeScript
npm install --save @nutriot/responsive-ratio
Import and initialize the module
import { responsiveRatio } from '@nutriot/responsive-ratio';
window.addEventListener('DOMContentLoaded', event => {
const options = {
selectors: 'iframe, video'
};
responsiveRatio(options);
});
Type: boolean
Default: true
Specifies whether to inject default styles
Type: string
Default: iframe
CSS selector for elements that should be resized
Type: string
Default: responsive-ratio
Specifies the wrapper elements default class name
This work is licensed under The MIT License