Skip to content

Instantly share code, notes, and snippets.

@dorward
Created February 27, 2014 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dorward/9249378 to your computer and use it in GitHub Desktop.
Save dorward/9249378 to your computer and use it in GitHub Desktop.
Replaces all images and background images with kittens
$(function () {
$('img').each(function (index, element) {
$img = $(element);
$img.attr('src', "http://placekitten.com/" + $img.width() + "/" + $img.height());
});
$('*').each(function (index, element) {
$e = $(element);
if ($e.css('background-image')) {
$e.css('background-image', "url(http://placekitten.com/" + $e.width() + "/" + $e.height() + ")")
}
});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment