Skip to content

Instantly share code, notes, and snippets.

@srobbin
Created January 31, 2012 21:26
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 srobbin/1713018 to your computer and use it in GitHub Desktop.
Save srobbin/1713018 to your computer and use it in GitHub Desktop.
<noscript><img src="Koala.jpg" alt="A koala" /></noscript>
<script>
$('noscript').each(function(){
var $self = $(this)
, $img = $( $self.text() )
, src = $img.attr("src") + ( screen.width < 500 ? "?width=420" : "" );
$self.replaceWith( $img.attr("src", src) );
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment