Get new jQuery plugins just once a week

×

Enquire-js

September 5, 2012

Enquire-js | Media queries in javascript

Enquire-js is A lightweight JavaScript library for handling CSS media queries.This js library Deals with your media queries being matched (and even unmatched!),Respond to browser events with aplomb And if you want to get really fancy, run one-time setup routines.
A typical example
enquire.register("screen and (max-width:1000px)", {

match : function() {}, // REQUIRED
// Triggered when the media query transitions
// *from an unmatched to a matched state*

unmatch : function() {}, // OPTIONAL
// If supplied, triggered when the media query transitions
// *from a matched state to an unmatched state*.

setup : function() {}, // OPTIONAL
// If supplied, triggered once immediately upon registration of the handler

deferSetup : true // OPTIONAL, defaults to false
// If set to true, defers execution the setup function
// until the media query is first matched. still triggered just once
});

Created by Nick Williams

Download

Example

enquire-js

Media queries in javascript

Enquire-js

Related posts:

Responsive Tables
Responsly-js
Tipue Drop
enquire-js

http://jquer.in/wp-content/uploads/2012/09/enquire-js.png

jQuery plugin

Sign up for our weekly newsletter.

* We won't spam you ever