radiovisual / jquery-responsive-ratio

Force DOM elements to be responsive at a specific aspect ratio.
MIT License
0 stars 0 forks source link

jquery-responsive-ratio Build Status

:boom: DEPRECATED: Do not use this module. No future work will be done here. Use FitVids instead. This module was meant to solve the problem of getting fluid (responsive) video embeds, which FitVids does nicely. :+1: :hamburger:

Force DOM elements to be responsive at a specific aspect ratio. Useful for keeping video elements displaying at their correct aspect ratio in responsive situations.

Install

with npm:

$ npm install --save jquery-responsive-ratio

or manually:

<script src='js/vendor/jquery.responsive-ratio.min.js'></script>

Usage

jQuery('iframe').makeResponsive();

API

jQuery($object).makeResponsive([options]);

$object

Required
The jQuery object or collection you want to make responsive.

options

ratio

Type: string
Default: '16:9'

The aspect ratio you want to force on the jQuery element.

class

Type: string
Default: responsive-ratio

The class name to assign to elements targeted by this plugin.

License

MIT © Michael Wuergler