Created
June 10, 2011 15:49
-
-
Save lifedraft/1019109 to your computer and use it in GitHub Desktop.
Alternative to adaptjs (http://adapt.960.gs/)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(w,d, ranges) { | |
var html = document.documentElement | |
window.onresize = function() { | |
var width = w.innerWidth || d.documentElement.clientWidth || d.body.clientWidth || 0; | |
for (var i=0; i < ranges.length; i++) { | |
if (ranges[i] < width) { | |
break; | |
}; | |
}; | |
html.className = "js zoom-width-" + (i+1); | |
}; | |
window.onresize(); | |
})(window, document, [0, 1280, 1420, 1560, 1700, 1840, 1980, 2120, 5000]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment