Created
October 18, 2011 20:37
-
-
Save matharchod/1296644 to your computer and use it in GitHub Desktop.
A core JavaScript liquid layout function that checks the current width of a browser window and assigns a new class to the BODY accordingly.
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
//LIQUID LAYOUT | |
function setScreenClass(){ | |
var fmt = document.documentElement.clientWidth; | |
var cls = (fmt>640&&fmt<=800)?'screen_low':(fmt>800&&fmt<=1024)?'screen_med':(fmt>1024&&fmt<=1280)?'screen_high':(fmt>1280)?'screen_wide':'screen_low'; | |
document.body.className=cls; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment