Created
October 11, 2015 16:43
-
-
Save chrdesigner/2d0b3bdda6ba275ea142 to your computer and use it in GitHub Desktop.
jQuery: addClass in <html> if size bellow 415
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
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