Skip to content

Takazudo/jQuery.ViewportWatcher

Repository files navigation

jQuery.ViewportWatcher

handle window's width change for responsive web design.

Demos

Usage

var watcher = new $.ViewportWatcher(function(o) {

  o.when(function(width) {
    if(width < 800) { return true; }
    return false;
  }, {
    match: function() {
      // do something
    }
  });

  o.when(function(width) {
    if(800 <= width) { return true; }
    return false;
  }, {
    match: function() {
      // do something
    }
  });

});

see demos for details

Depends

Browsers

IE6+ and other new browsers.

How to build

git clone, then git submodule init, git submodule update.
Then, grunt to build or grunt watch to watch coffee file's change.

License

Copyright (c) 2013 "Takazudo" Takeshi Takatsudo
Licensed under the MIT license.

Build

Use