Skip to content

Instantly share code, notes, and snippets.

@danielck
Created March 16, 2013 10:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielck/5175788 to your computer and use it in GitHub Desktop.
Save danielck/5175788 to your computer and use it in GitHub Desktop.
function checkWidth () {
if ($(window).width() > 1400) {
$('body').attr('class','superwide');
$('#title').text('Wide ('+$(window).width()+')');
}
else if ($(window).width() > 1100) {
$('body').attr('class','wide');
$('#title').text('Wide ('+$(window).width()+')');
}
else if ($(window).width() > 800) {
$('body').attr('class','normal');
$('#title').text('Normal ('+$(window).width()+')');
}
else if ($(window).width() > 600) {
$('body').attr('class','slim');
$('#title').text('Slim ('+$(window).width()+')');
}
else {
$('body').attr('class','narrow');
$('#title').text('Narrow ('+$(window).width()+')');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment