Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.
/ responsive-ratio Public archive

Library to adjust iFrame aspect-ratios reponsively

License

Notifications You must be signed in to change notification settings

nutriot/responsive-ratio

Repository files navigation

@nutriot/responsive-ratio

Library to adjust iFrame aspect-ratios reponsively, written in TypeScript

npm npm CircleCI

Installation

npm install --save @nutriot/responsive-ratio

Usage

Import and initialize the module

import { responsiveRatio } from '@nutriot/responsive-ratio';

window.addEventListener('DOMContentLoaded', event => {
  const options = {
    selectors: 'iframe, video'
  };

  responsiveRatio(options);
});

Options

injectStyles

Type: boolean
Default: true

Specifies whether to inject default styles

selectors

Type: string
Default: iframe

CSS selector for elements that should be resized

wrapperClass

Type: string
Default: responsive-ratio

Specifies the wrapper elements default class name

License

This work is licensed under The MIT License