Logan Tumbles!

I couldn’t take it anymore. The flash photo sets on tumblr were killing me. I’ve been wanting to make photo posts with multiple photos sans the flash slideshow WITH high res images since day one. The functionality tumblr provides in this area is obtrusive and inconsistent.

I’m using Chris Kalani’s “JQuery Kill Photoset” script on a client’s website and it works spectacularly well.  However I was pretty annoyed with this script because it didn’t allow for photosets to display captions under their respective photos. 

So, I edited the script.  To get captions to display, add this:

var caption = this[“caption”];
$this.append(‘<p>’+caption+’</p>’);

after this:

var img = this[“photo-url-“+o.photoSize];
$this.append(‘<p><img src=”’+img+’” /></p>’);

All together, now:

;(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>’);
                 var caption = this[“caption”];
                $this.append(‘<p>’+caption+’</p>’);
                });
            });
        });
    };
})(jQuery);

Actually does it’s job now.  Thanks Chris Kalani for this script in the first place.

DEAR FOLLOWERS: Sorry for the nerdiness.  Back to your regularly scheduled programming of cute animals, motivating quotes, and celebrity news.

  1. arolabs reblogged this from chriskalani
  2. coolrandomstuffyeah reblogged this from prostheticknowledge
  3. seenslashsaw reblogged this from chriskalani and added:
    I’m using Chris Kalani’s “JQuery Kill Photoset” script...client’s website
  4. luclatulippe reblogged this from chriskalani and added:
    Thank you Chris! This...so much better than
  5. realityshmality reblogged this from robynchell
  6. stanleylieber reblogged this from prostheticknowledge