Skip to content

Instantly share code, notes, and snippets.

@jonathanmoore
Created April 4, 2011 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonathanmoore/901641 to your computer and use it in GitHub Desktop.
Save jonathanmoore/901641 to your computer and use it in GitHub Desktop.
Paste this into the Description field.
<script type="text/javascript">
;(function($){
var defaults = {
photoSize: 1280
};
$.fn.killPhotoset = function(options){
var o = $.extend(defaults, options);
return this.each(function(){
var $this = $(this);
$this.empty();
var set = $this.attr("id");
var id = set.split("_")[1];
$.getJSON("/api/read/json?id="+id+"&callback=?", function(boom){
var pix = boom["posts"][0]["photos"];
$.each(pix, function(){
var img = this["photo-url-"+o.photoSize];
$this.append('<p><img src="'+img+'" /></p>');
});
});
});
};
})(jQuery);
$('.html_photoset').killPhotoset({
photoSize: 1280
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment