Skip to content

Instantly share code, notes, and snippets.

@chrdesigner
Created October 11, 2015 16:43
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 chrdesigner/2d0b3bdda6ba275ea142 to your computer and use it in GitHub Desktop.
Save chrdesigner/2d0b3bdda6ba275ea142 to your computer and use it in GitHub Desktop.
jQuery: addClass in <html> if size bellow 415
var $window = $(window), $html = $('html');
$window.resize(function resize(){
if ($window.width() < 415) {
return $html.addClass('mobile');
}
$html.removeClass('mobile');
}).trigger('resize');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment