diff --git a/jquery.lightbox.min.js b/jquery.lightbox.min.js index 9fb59cf..441d936 100644 --- a/jquery.lightbox.min.js +++ b/jquery.lightbox.min.js @@ -10,16 +10,4 @@ * minSize - int - default 0. Min window width or height to open lightbox. Below threshold will open image in a new tab. * */ - /*! - * jquery.lightbox.js - * https://github.com/duncanmcdougall/Responsive-Lightbox - * Copyright 2013 Duncan McDougall and other contributors; @license Creative Commons Attribution 2.5 - * - * Options: - * margin - int - default 50. Minimum margin around the image - * nav - bool - default true. enable navigation - * blur - bool - default true. Blur other content when open using css filter - * minSize - int - default 0. Min window width or height to open lightbox. Below threshold will open image in a new tab. - * - */ -(function(e){"use strict";e.fn.lightbox=function(t){var n={margin:50,nav:true,blur:true,minSize:0};var r={items:[],lightbox:null,image:null,current:null,locked:false,selector:"#lightbox",init:function(t){r.items=t;r.selector="lightbox-"+Math.random().toString().replace(".","");if(!r.lightbox){e("body").append('");r.lightbox=e("."+r.selector)}if(r.items.length>1&&n.nav){e(".lightbox-nav",r.lightbox).show()}else{e(".lightbox-nav",r.lightbox).hide()}r.bindEvents()},loadImage:function(){if(n.blur){e("body").addClass("blurred")}e("img",r.lightbox).remove();r.lightbox.fadeIn("fast").append('');var t=e('');e(t).load(function(){e(".lightbox-loading").remove();r.lightbox.append(t);r.image=e("img",r.lightbox).hide();r.resizeImage()})},resizeImage:function(){var t,i,s,o,u;i=e(window).height()-n.margin;s=e(window).outerWidth(true)-n.margin;r.image.width("").height("");o=r.image.height();u=r.image.width();if(u>s){t=s/u;u=s;o=Math.round(o*t)}if(o>i){t=i/o;o=i;u=Math.round(u*t)}r.image.width(u).height(o).css({top:(e(window).height()-r.image.outerHeight())/2+"px",left:(e(window).width()-r.image.outerWidth())/2+"px"}).show();r.locked=false},getCurrentIndex:function(){return e.inArray(r.current,r.items)},next:function(){if(r.locked){return false}r.locked=true;if(r.getCurrentIndex()>=r.items.length-1){e(r.items[0]).click()}else{e(r.items[r.getCurrentIndex()+1]).click()}},previous:function(){if(r.locked){return false}r.locked=true;if(r.getCurrentIndex()<=0){e(r.items[r.items.length-1]).click()}else{e(r.items[r.getCurrentIndex()-1]).click()}},bindEvents:function(){e(r.items).click(function(t){if(!e("#lightbox").is(":visible")&&(e(window).width()