assets/javascripts/fancybox/helpers/jquery.fancybox-thumbs.js in jekyll-theme-simple-texture-0.2.3 vs assets/javascripts/fancybox/helpers/jquery.fancybox-thumbs.js in jekyll-theme-simple-texture-0.3.0

- old
+ new

@@ -12,11 +12,11 @@ * } * } * }); * */ -(function ($) { +;(function ($) { //Shortcut for fancyBox object var F = $.fancybox; //Add helper object F.helpers.thumbs = { @@ -60,17 +60,18 @@ this.wrap = $('<div id="fancybox-thumbs"></div>').addClass(opts.position).appendTo('body'); this.list = $('<ul>' + list + '</ul>').appendTo(this.wrap); //Load each thumbnail $.each(obj.group, function (i) { - var href = thumbSource( obj.group[ i ] ); + var el = obj.group[ i ], + href = thumbSource( el ); if (!href) { return; } - $("<img />").load(function () { + $("<img />").on("load", function () { var width = this.width, height = this.height, widthRatio, heightRatio, parent; if (!that.list || !width || !height) { @@ -103,11 +104,13 @@ parent.width(thumbWidth).height(thumbHeight); $(this).hide().appendTo(parent).fadeIn(300); - }).attr('src', href); + }) + .attr('src', href) + .attr('title', el.title); }); //Set initial width this.width = this.list.children().eq(0).outerWidth(true); @@ -157,6 +160,6 @@ this.list = null; this.width = 0; } } -}(jQuery)); \ No newline at end of file +}(jQuery));