Get new jQuery plugins just once a week

×

Adapt-js

September 15, 2012

Adapt-js | Change the CSS according to browser

Adapt-js is a lightweight (848 bytes minified) JavaScript file that determines which CSS file to load before the browser renders a page. If the browser tilts or resizes, Adapt.js simply checks its width, and serves only the CSS that is needed, when it is needed.
Adapt.js, accepts a few parameters: path is where your stylesheets reside, dynamic is a boolean (true or false) that says whether to watch the window for its resize event, also triggered by tablet or phone tilt. Widths and optional CSS files are specified in range. The defaults are shown in the adjacent code example. You can also specify an optional callback function, that will pass range index and width.
In the case of JavaScript being purposefully disabled or unavailable, stylesheet defaults can be served via

Created by Nathan Smith

Download

Example

adapt js

Adapt js | Adaptive CSS

Adapt-js

Related posts:

animsition
dynamic-timeline
tempgauge
adapt js

http://jquer.in/wp-content/uploads/2012/09/adapt-js.jpg

jQuery plugin

Sign up for our weekly newsletter.

* We won't spam you ever