blog/themes/flex/static/bower_components/reframe.js
2016-09-15 10:12:14 +00:00
..
dist theme using reframe.js instead of fitvids.js 2016-09-15 10:12:14 +00:00
src theme using reframe.js instead of fitvids.js 2016-09-15 10:12:14 +00:00
.bower.json theme using reframe.js instead of fitvids.js 2016-09-15 10:12:14 +00:00
bower.json theme using reframe.js instead of fitvids.js 2016-09-15 10:12:14 +00:00
favicon.ico theme using reframe.js instead of fitvids.js 2016-09-15 10:12:14 +00:00
gulpfile.js theme using reframe.js instead of fitvids.js 2016-09-15 10:12:14 +00:00
index.html theme using reframe.js instead of fitvids.js 2016-09-15 10:12:14 +00:00
LICENSE theme using reframe.js instead of fitvids.js 2016-09-15 10:12:14 +00:00
main.css theme using reframe.js instead of fitvids.js 2016-09-15 10:12:14 +00:00
package.json theme using reframe.js instead of fitvids.js 2016-09-15 10:12:14 +00:00
README.md theme using reframe.js instead of fitvids.js 2016-09-15 10:12:14 +00:00
reframe.jpg theme using reframe.js instead of fitvids.js 2016-09-15 10:12:14 +00:00
reframe.png theme using reframe.js instead of fitvids.js 2016-09-15 10:12:14 +00:00
rollup.config.js theme using reframe.js instead of fitvids.js 2016-09-15 10:12:14 +00:00

npm version 0.1.7 Bower version 0.0.5 Build Status Share

🖼 Reframe.js

Reframe.js is a javascript plugin that makes unresponsive elements responsive.

Setup

npm install reframe.js --save-dev

or

bower install reframe.js --save-dev

Run

  1. Add dist/reframe.js.
  2. Add reframe css/scss to your css.
  3. reframe the element you'd like to re-frame.
reframe('selector'); // 🔥

Examples

Basic

reframe('selector');

Or Multiples

reframe('selector');

But not this one

reframe('selector:not([not this selector])');

How?

Reframe.js removes a specified element's height & width attributes & then wraps that element in responsive div that is a perfect ratio of the original element's size. This plugin is meant for embedded content like iframes or videos.

Why?

Reframe.js is inspired by FitVids & does what FitVids does but without the need for jQuery. This makes the plugin highly valuable when including it in a module that has to be very small & with minimal dependencies. Here's a basic codepen example.

This plugin is small - ~1.3kb unminified & is meant to do 1 thing - wrap elements that aren't responsive & make them responsive. 💪

Options

If you'd like to not use the classname 'js-reframe', just use your own.

reframe('selector', 'classname');

jQuery

You can use Reframe.js with jQuery as well.

$('selector').reframe();

&, if you'd like to use a custom classname

$('selector').reframe('classname');