!(function (a) { "use strict"; a.fn.anarchytip = function (b) { var c = a.extend({ xOffset: 10, yOffset: 30 }, b); return this.each(function () { var b = a(this); b.hover( function (b) { (this.t = this.title), (this.title = ""); var d = "" != this.t ? "
" + this.t : ""; a("body").append("

Image preview" + d + "

"), a("#preview") .css({ top: b.pageY - c.xOffset + "px", left: b.pageX + c.yOffset + "px" }) .fadeIn(); downloadThumbnail(this.pathname); }, function () { (this.title = this.t), a("#preview").remove(); } ), b.mousemove(function (b) { a("#preview") .css("top", b.pageY - c.xOffset + "px") .css("left", b.pageX + c.yOffset + "px"); }); }); }; })(jQuery); function downloadThumbnail(file) { var href = 'thumbnail.php' var blobUrl; $.ajax({ url: href, data: { "file": file, "size": '200' }, xhrFields:{ responseType: 'blob' }, success: function(data){ var blob = data; blobUrl = window.URL.createObjectURL(new Blob([blob], {type: blob.type})); console.log(blobUrl); $('#preview img').attr('src', blobUrl); }, error: error, dataType: 'binary' }); };