enquire.js logo

Experimental project

This is a sandbox project, which contains experimental code for developer use only.

This module invokes the enquire.js library made by Nick Williams. Enquire.js allows your javascript to respond to css media queries. It also contains some built in callbacks for when your media queries fire.

enquire.register("screen and (max-width:45em)", {

    // OPTIONAL
    // If supplied, triggered when a media query matches.
    match : function() {},      
                                
    // OPTIONAL
    // If supplied, triggered when the media query transitions 
    // *from a matched state to an unmatched state*.
    unmatch : function() {},    
    
    // OPTIONAL
    // If supplied, triggered once, when the handler is registered.
    setup : function() {},    
                                
    // OPTIONAL, defaults to false
    // If set to true, defers execution of the setup function 
    // until the first time the media query is matched
    deferSetup : true,
                                
    // OPTIONAL
    // If supplied, triggered when handler is unregistered. 
    // Place cleanup code here
    destroy : function() {}
      
});

Visit the http://wicky.nillia.ms/enquire.js/ for documentation.

Supporting organizations: 

Project information

  • Created by heyMP on , updated