Skip to content

Instantly share code, notes, and snippets.

@ABooooo
Last active November 1, 2018 08:13
Show Gist options
  • Save ABooooo/b5576546017c3cf62460 to your computer and use it in GitHub Desktop.
Save ABooooo/b5576546017c3cf62460 to your computer and use it in GitHub Desktop.
check img width and add class
// add img responsive class
$.each($('.news img'), function (index, item) {
if ($(item).width() >= 600) {
$(item).addClass("img-responsive");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment