Skip to content

Instantly share code, notes, and snippets.

@KengoTODA
Created December 9, 2010 03:25
Show Gist options
  • Select an option

  • Save KengoTODA/734292 to your computer and use it in GitHub Desktop.

Select an option

Save KengoTODA/734292 to your computer and use it in GitHub Desktop.
/*
* Thumbnail API(http://img.simpleapi.net/) with jQuery
* sample: http://jsdo.it/eller86/cnuG
*/
;(function($){
$.thumbnail = $.thumbnail || function(sourceUrl){
return $('<a>').attr('href', sourceUrl).append(
$('<img>').attr({
src: 'http://img.simpleapi.net/small/' + sourceUrl,
width: 128,
height: 128,
alt: 'thumbnail'
})
);
};
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment