handle window's width change for responsive web design.
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
- EveEve
- viewportSize
- jQuery 1.10.2
IE6+ and other new browsers.
git clone, then git submodule init
, git submodule update
.
Then, grunt
to build or grunt watch
to watch coffee file's change.
Copyright (c) 2013 "Takazudo" Takeshi Takatsudo
Licensed under the MIT license.
Use