diff --git a/README.md b/README.md index 71b14af..9cb2994 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,12 @@ Also, you can use `data-href` attribute on any element, not only links. /* close image */ $.abigimage.close(); + /* unbind abigimage events */ + $.abigimage.unbind(); + +## Changes + +- *1.3.0* - fixed image caching, added `unbind` method. ## License diff --git a/abigimage.jquery.js b/abigimage.jquery.js index c5faf69..34fd3e7 100644 --- a/abigimage.jquery.js +++ b/abigimage.jquery.js @@ -1,6 +1,6 @@ /** * http://aeqdev.com/tools/js/abigimage/ - * v 1.2.8 + * v 1.3.0 * * Copyright © 2014 Maksim Krylosov * @@ -78,6 +78,13 @@ } } + function replaceImage(oldImage, newSrc) { + // force clear cache + var newImage = oldImage.removeAttr('src').clone(true).attr('src', newSrc); + oldImage.replaceWith(newImage); + return newImage; + } + function open(src, openI) { if ('number' === typeof src) { if (src === i || src < 0 || src > t.length - 1) { @@ -98,12 +105,12 @@ opened = true; - // removeAttr to force image reloading instead of replacing on load - img.removeAttr('src').attr('src', src); + img = replaceImage(img, src); + listenTouchEvents(); var $tn = $(t[nextI()]); - imgNext.removeAttr('src').attr('src', $tn.data('href') || $tn.attr('href')); + imgNext = replaceImage(imgNext, $tn.data('href') || $tn.attr('href')); var $tp = $(t[prevI()]); - imgPrev.removeAttr('src').attr('src', $tp.data('href') || $tp.attr('href')); + imgPrev = replaceImage(imgPrev, $tp.data('href') || $tp.attr('href')); overlay.fadeIn(opts.fadeIn); layout.fadeIn(opts.fadeIn); @@ -131,6 +138,10 @@ return false; } + function unbind() { + t.unbind('click.abigimage'); + } + prevBtnWrapper.click(function() { return prev(); }); @@ -174,6 +185,14 @@ bs = box[0].style; touchReset(); + listenTouchEvents(); + + function listenTouchEvents() { + img[0].addEventListener('touchstart', touchstart); + img[0].addEventListener('touchmove', touchmove); + img[0].addEventListener('touchend', touchend); + img[0].addEventListener('touchcancel', touchend); + } function touchReset() { x = 0; @@ -201,7 +220,7 @@ ); } - img[0].addEventListener('touchstart', function(e) { + function touchstart(e) { if (!opened) return; if (e.touches.length > 1) { multi = true; @@ -223,9 +242,9 @@ dy = 0; touches = e.touches; e.preventDefault(); - }); + } - img[0].addEventListener('touchmove', function(e) { + function touchmove(e) { if (!opened) return; dx = (med(e.touches, 'X') - med(touches, 'X')); dy = (med(e.touches, 'Y') - med(touches, 'Y')); @@ -254,10 +273,7 @@ } slideQueueAnimate(x, y, s, false); e.preventDefault(); - }); - - img[0].addEventListener('touchend', touchend); - img[0].addEventListener('touchcancel', touchend); + } function touchend(e) { if (!opened) return; @@ -449,7 +465,8 @@ open: open, next: next, prev: prev, - close: close + close: close, + unbind: unbind }; $.fn.abigimage.defaults = { diff --git a/abigimage.jquery.json b/abigimage.jquery.json index 8129f5d..c05e9b1 100644 --- a/abigimage.jquery.json +++ b/abigimage.jquery.json @@ -1,6 +1,6 @@ { "name": "abigimage", - "version": "1.2.8", + "version": "1.3.0", "title": "ABigImage - view big versions of images", "author": { "name": "Maksim Krylosov", @@ -14,7 +14,7 @@ "dependencies": { "jquery": ">=1.9" }, - "description": "Fit mobile devices. Uses CSS3 transform and transition for smooth touch sliding. Touch slide left or right opens next or previous image, touch slide up or down closes image. Clicking image opens next one, clicking left side opens previous, clicking right side closes image. Hotkeys for next, previous and close buttons. Closing after viewing of all images. Preloading of next and previous images. Uses link's `href` or `data-href` attribute for large images. Fully customizable styles. Customizable bottom area. Customizable `onopen` event.", + "description": "Fit mobile devices. Uses CSS3 transform and transition for smooth touch sliding. Touch slide left or right opens next or previous image, touch slide up or down closes image. Clicking image opens next one, clicking left side opens previous, clicking right side closes image. Hotkeys for next, previous and close buttons. Closing after viewing of all images. Preloading of next and previous images. Multi-touch zoom. Uses link's `href` or `data-href` attribute for large images. Fully customizable styles. Customizable bottom area. Customizable `onopen` event.", "keywords": [ "image", "picture", diff --git a/abigimage.jquery.min.js b/abigimage.jquery.min.js index 7294839..8e2199c 100644 --- a/abigimage.jquery.min.js +++ b/abigimage.jquery.min.js @@ -1 +1 @@ -(function(R){var ak=R("
").css({display:"none"}).appendTo("body"),P=R("
").css({display:"none"}).appendTo("body"),n=R("
").appendTo(P),U=R("
").appendTo(n),F=R("
").appendTo(U),v=R("
").appendTo(F),B=R("
").appendTo(n),M=R("
").appendTo(B),V=R("
").appendTo(M),p=R("").appendTo(n),z=R("").appendTo(n),ac=R("").appendTo(n),b=R("
").appendTo(P);var N={},ad=null,aj=null,am=0,D=false;function ah(){var d=aj+1;if(d>=ad.length){d=0}return d}function o(){var d=aj-1;if(d<0){d=ad.length-1}return d}function f(){if(am===ad.length-1){return af()}else{++am;return K(ah())}}function O(){if(am===1-ad.length){return af()}else{--am;return K(o())}}function G(d){if(N.keyNext.indexOf(d.which)!==-1){f();return false}else{if(N.keyPrev.indexOf(d.which)!==-1){O();return false}else{if(N.keyClose.indexOf(d.which)!==-1){af();return false}}}}function K(k,d){if("number"===typeof k){if(k===aj||k<0||k>ad.length-1){return}aj=k;var t=R(ad[aj]);k=t.data("href")||t.attr("href")}else{if("number"!==typeof d){d=-1}if(aj===d){return}aj=d}D=true;p.removeAttr("src").attr("src",k);var s=R(ad[ah()]);z.removeAttr("src").attr("src",s.data("href")||s.attr("href"));var i=R(ad[o()]);ac.removeAttr("src").attr("src",i.data("href")||i.attr("href"));ak.fadeIn(N.fadeIn);P.fadeIn(N.fadeIn);N.onopen.call(ad,ad[aj],aj);R(document).unbind("keydown",G).bind("keydown",G);return false}function af(){if(!D){return}D=false;aj=null;am=0;ak.fadeOut(N.fadeOut);P.fadeOut(N.fadeOut,I);N.onclose.call(ad);R(document).unbind("keydown",G);return false}U.click(function(){return O()});B.click(function(){return af()});var h=function(d){d.preventDefault()};P.on("touchmove",h).on("wheel",h);var r,q,w,ab,Z,ae,ai,l,g,J,T,L,a,e,an,C,ap,aa,A=false,X=[null,null,null],ag=n[0].style;ao();function ao(){ab=0;Z=0;ae=1;C=null;aa=false;if(N.imgCSS){p.css({zIndex:N.imgCSS.zIndex})}}function E(k,x){var s=0;for(var i=0,d=k.length;i1){aa=true;ai=al(d);p.css({zIndex:N.prevBtnBoxCSS.zIndex})}else{C=null;L=(new Date()).getTime();a=n.width()*0.34;e=n.height();an=N.slideWidth*a;J=p.width();T=p.height()}r=ab;q=Z;w=ae;l=0;g=0;ap=d.touches;d.preventDefault()});p[0].addEventListener("touchmove",function(k){if(!D){return}l=(E(k.touches,"X")-E(ap,"X"));g=(E(k.touches,"Y")-E(ap,"Y"));ab=r+l/ae;Z=q+g/ae;if(k.touches.length>1){ae=Math.max(1,w*(al(k)/ai))}if(ae>N.zoomMin){var s=0.5*(J-(J/ae));var i=0.5*(T-(T/ae));ab=Math.max(-s,Math.min(s,ab));Z=Math.max(-i,Math.min(i,Z))}else{if(null===C){var d=Math.abs(g)-Math.abs(l);if(Math.abs(d)>2){C=d>0}}if(C){ab=0}else{Z=0}}S(ab,Z,ae,false);k.preventDefault()});p[0].addEventListener("touchend",W);p[0].addEventListener("touchcancel",W);function W(i){if(!D){return}var d=(new Date()).getTime()-L;if(!i.touches.length){if(ae<=N.zoomMin){if(d<=1||(l>=-1&&l<=1&&g>=-1&&g<=1)){if(aa){u(0,0,1)}else{Q(true)}}else{if(C){var k=Math.abs(g);if(k>an){c()}else{if(k/d>N.slideVelocity){c()}else{j()}}}else{if(l<-an){Q()}else{if(l>an){m()}else{if(Math.abs(l)/d>N.slideVelocity){if(l<0){Q()}else{m()}}else{j()}}}}}ao()}else{if(ae>N.zoomMax){ae=N.zoomMax;S(ab,Z,ae,true)}}}if(ae<=N.zoomMin){p.css({zIndex:N.imgCSS.zIndex})}ap=i.touches;i.preventDefault()}n.on("transitionend webkitTransitionEnd msTransitionEnd oTransitionEnd",I);function I(){A=false;for(var d=0;d<2;d++){if(X[d]){X[d]();X[d]=null;if(A){break}}}}p.click(function(){return f()});function Q(d){S(d?0:-a,0,1,!d);Y(f)}function m(){S(a,0,1,true);Y(O)}function j(){S(0,0,1,true)}function c(){j();Y();af()}function H(k,d){if(A){X[d||0]=k}else{k()}}function S(d,ar,t,aq,k){H(function(){u(d,ar,t,aq)},k)}function Y(d){H(function(){u(0,0,1,false);if(d){d()}},1)}function u(d,aq,k,t){A=t;var i="scale("+k+") translate3d("+d+"px, "+aq+"px, 0)";ag.transition=t?"all .2s ease-out":"";ag.webkitTransform=i;ag.mozTransform=i;ag.msTransform=i;ag.oTransform=i;ag.transform=i}R.fn.abigimage=function(s){ad=this;N=R.extend(true,R.fn.abigimage.defaults,s);this.overlay=ak.attr(N.overlayAttrs).css(N.overlayCSS);this.layout=P.attr(N.layoutAttrs).css(N.layoutCSS);this.box=n.attr(N.boxAttrs).css(N.boxCSS);this.prevBtnWrapper=U.attr(N.prevBtnWrapperAttrs).css(N.prevBtnWrapperCSS);this.prevBtnBox=F.attr(N.prevBtnBoxAttrs).css(N.prevBtnBoxCSS);this.prevBtn=v.attr(N.prevBtnAttrs).css(N.prevBtnCSS).html(N.prevBtnHtml);this.closeBtnWrapper=B.attr(N.closeBtnWrapperAttrs).css(N.closeBtnWrapperCSS);this.closeBtnBox=M.attr(N.closeBtnBoxAttrs).css(N.closeBtnBoxCSS);this.closeBtn=V.attr(N.closeBtnAttrs).css(N.closeBtnCSS).html(N.closeBtnHtml);this.img=p.attr(N.imgAttrs).css(N.imgCSS);this.imgNext=z.attr(N.imgNextAttrs).css(N.imgNextCSS);this.imgPrev=ac.attr(N.imgPrevAttrs).css(N.imgPrevCSS);this.bottom=b.attr(N.bottomAttrs).css(N.bottomCSS);var k={};for(var t in N.prevBtnHoverCSS){if(N.prevBtnCSS){k[t]=N.prevBtnCSS[t]}}var d={};for(var t in N.closeBtnHoverCSS){if(N.closeBtnCSS){d[t]=N.closeBtnCSS[t]}}var i={};for(var t in N.bottomHoverCSS){if(N.bottomCSS){i[t]=N.bottomCSS[t]}}this.prevBtnWrapper.hover(function(){v.stop().animate(N.prevBtnHoverCSS,N.fadeIn)},function(){v.stop().animate(k,N.fadeOut)});this.closeBtnWrapper.hover(function(){V.stop().animate(N.closeBtnHoverCSS,N.fadeIn)},function(){V.stop().animate(d,N.fadeOut)});this.bottom.hover(function(){b.stop().animate(N.bottomHoverCSS,N.fadeIn)},function(){b.stop().animate(i,N.fadeOut)});return this.each(function(x){R(this).unbind("click.abigimage").bind("click.abigimage",function(){return K(x)})})};R.abigimage={open:K,next:f,prev:O,close:af};R.fn.abigimage.defaults={fadeIn:"fast",fadeOut:"fast",slideWidth:0.4,slideVelocity:0.4,zoomMin:1.5,zoomMax:5,prevBtnHtml:"←",closeBtnHtml:"x",keyNext:[13,32,39,40],keyPrev:[8,37,38],keyClose:[27,35,36],onopen:function(){},onclose:function(){},overlayCSS:{position:"fixed",zIndex:101,top:0,right:0,bottom:0,left:0,backgroundColor:"#000",opacity:0.9},layoutCSS:{position:"fixed",zIndex:101,top:0,right:0,bottom:0,left:0,"-webkit-user-select":"none","-moz-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)",lineHeight:2.5},boxCSS:{position:"absolute",width:"312.5%",height:"100%",left:"-106.25%",top:0},prevBtnWrapperCSS:{cursor:"pointer",position:"absolute",top:0,right:"50%",bottom:0,left:0},closeBtnWrapperCSS:{cursor:"pointer",position:"absolute",top:0,right:0,bottom:0,left:"50%"},prevBtnBoxCSS:{position:"absolute",zIndex:103,top:0,bottom:0,left:"68%"},closeBtnBoxCSS:{position:"absolute",zIndex:103,top:0,bottom:0,right:"68%"},prevBtnCSS:{color:"#fff",backgroundColor:"#000",opacity:0.5,padding:"0 1em",borderRadius:"0 0 1ex 0"},closeBtnCSS:{color:"#fff",backgroundColor:"#000",opacity:0.5,padding:"0 1em",borderRadius:"0 0 0 1ex"},prevBtnHoverCSS:{opacity:1},closeBtnHoverCSS:{opacity:1},imgCSS:{position:"absolute",zIndex:102,margin:"auto",width:"auto",top:0,right:0,bottom:0,left:0,display:"block",cursor:"pointer",maxWidth:"32%",maxHeight:"100%"},imgNextCSS:{position:"absolute",margin:"auto",width:"auto",top:0,right:0,bottom:0,left:"68%",display:"block",maxWidth:"32%",maxHeight:"100%"},imgPrevCSS:{position:"absolute",margin:"auto",width:"auto",top:0,right:"68%",bottom:0,left:0,display:"block",maxWidth:"32%",maxHeight:"100%"},bottomCSS:{position:"fixed",zIndex:104,right:0,bottom:0,left:0,"-webkit-user-select":"text","-moz-user-select":"text","user-select":"text",backgroundColor:"#000",color:"#fff",opacity:0.5,padding:"0 1em",textAlign:"center"},bottomHoverCSS:{opacity:1},overlayAttrs:{},layoutAttrs:{},boxAttrs:{},prevBtnWrapperAttrs:{},prevBtnBoxAttrs:{},prevBtnAttrs:{},closeBtnWrapperAttrs:{},closeBtnBoxAttrs:{},closeBtnAttrs:{},imgAttrs:{},imgNextAttrs:{},imgPrevAttrs:{},bottomAttrs:{}}}(jQuery)); \ No newline at end of file +(function(U){var ao=U("
").css({display:"none"}).appendTo("body"),S=U("
").css({display:"none"}).appendTo("body"),n=U("
").appendTo(S),Y=U("
").appendTo(n),G=U("
").appendTo(Y),v=U("
").appendTo(G),B=U("
").appendTo(n),O=U("
").appendTo(B),Z=U("
").appendTo(O),p=U("").appendTo(n),z=U("").appendTo(n),ag=U("").appendTo(n),b=U("
").appendTo(S);var P={},ah=null,an=null,aq=0,D=false;function al(){var d=an+1;if(d>=ah.length){d=0}return d}function o(){var d=an-1;if(d<0){d=ah.length-1}return d}function f(){if(aq===ah.length-1){return aj()}else{++aq;return M(al())}}function Q(){if(aq===1-ah.length){return aj()}else{--aq;return M(o())}}function H(d){if(P.keyNext.indexOf(d.which)!==-1){f();return false}else{if(P.keyPrev.indexOf(d.which)!==-1){Q();return false}else{if(P.keyClose.indexOf(d.which)!==-1){aj();return false}}}}function V(i,d){var k=i.removeAttr("src").clone(true).attr("src",d);i.replaceWith(k);return k}function M(k,d){if("number"===typeof k){if(k===an||k<0||k>ah.length-1){return}an=k;var t=U(ah[an]);k=t.data("href")||t.attr("href")}else{if("number"!==typeof d){d=-1}if(an===d){return}an=d}D=true;p=V(p,k);R();var s=U(ah[al()]);z=V(z,s.data("href")||s.attr("href"));var i=U(ah[o()]);ag=V(ag,i.data("href")||i.attr("href"));ao.fadeIn(P.fadeIn);S.fadeIn(P.fadeIn);P.onopen.call(ah,ah[an],an);U(document).unbind("keydown",H).bind("keydown",H);return false}function aj(){if(!D){return}D=false;an=null;aq=0;ao.fadeOut(P.fadeOut);S.fadeOut(P.fadeOut,K);P.onclose.call(ah);U(document).unbind("keydown",H);return false}function I(){ah.unbind("click.abigimage")}Y.click(function(){return Q()});B.click(function(){return aj()});var h=function(d){d.preventDefault()};S.on("touchmove",h).on("wheel",h);var r,q,w,af,ad,ai,am,l,g,L,X,N,a,e,at,C,av,ae,A=false,ab=[null,null,null],ak=n[0].style;au();R();function R(){p[0].addEventListener("touchstart",ar);p[0].addEventListener("touchmove",E);p[0].addEventListener("touchend",aa);p[0].addEventListener("touchcancel",aa)}function au(){af=0;ad=0;ai=1;C=null;ae=false;if(P.imgCSS){p.css({zIndex:P.imgCSS.zIndex})}}function F(k,x){var s=0;for(var i=0,d=k.length;i1){ae=true;am=ap(d);p.css({zIndex:P.prevBtnBoxCSS.zIndex})}else{C=null;N=(new Date()).getTime();a=n.width()*0.34;e=n.height();at=P.slideWidth*a;L=p.width();X=p.height()}r=af;q=ad;w=ai;l=0;g=0;av=d.touches;d.preventDefault()}function E(k){if(!D){return}l=(F(k.touches,"X")-F(av,"X"));g=(F(k.touches,"Y")-F(av,"Y"));af=r+l/ai;ad=q+g/ai;if(k.touches.length>1){ai=Math.max(1,w*(ap(k)/am))}if(ai>P.zoomMin){var s=0.5*(L-(L/ai));var i=0.5*(X-(X/ai));af=Math.max(-s,Math.min(s,af));ad=Math.max(-i,Math.min(i,ad))}else{if(null===C){var d=Math.abs(g)-Math.abs(l);if(Math.abs(d)>2){C=d>0}}if(C){af=0}else{ad=0}}W(af,ad,ai,false);k.preventDefault()}function aa(i){if(!D){return}var d=(new Date()).getTime()-N;if(!i.touches.length){if(ai<=P.zoomMin){if(d<=1||(l>=-1&&l<=1&&g>=-1&&g<=1)){if(ae){u(0,0,1)}else{T(true)}}else{if(C){var k=Math.abs(g);if(k>at){c()}else{if(k/d>P.slideVelocity){c()}else{j()}}}else{if(l<-at){T()}else{if(l>at){m()}else{if(Math.abs(l)/d>P.slideVelocity){if(l<0){T()}else{m()}}else{j()}}}}}au()}else{if(ai>P.zoomMax){ai=P.zoomMax;W(af,ad,ai,true)}}}if(ai<=P.zoomMin){p.css({zIndex:P.imgCSS.zIndex})}av=i.touches;i.preventDefault()}n.on("transitionend webkitTransitionEnd msTransitionEnd oTransitionEnd",K);function K(){A=false;for(var d=0;d<2;d++){if(ab[d]){ab[d]();ab[d]=null;if(A){break}}}}p.click(function(){return f()});function T(d){W(d?0:-a,0,1,!d);ac(f)}function m(){W(a,0,1,true);ac(Q)}function j(){W(0,0,1,true)}function c(){j();ac();aj()}function J(k,d){if(A){ab[d||0]=k}else{k()}}function W(d,ax,t,aw,k){J(function(){u(d,ax,t,aw)},k)}function ac(d){J(function(){u(0,0,1,false);if(d){d()}},1)}function u(d,aw,k,t){A=t;var i="scale("+k+") translate3d("+d+"px, "+aw+"px, 0)";ak.transition=t?"all .2s ease-out":"";ak.webkitTransform=i;ak.mozTransform=i;ak.msTransform=i;ak.oTransform=i;ak.transform=i}U.fn.abigimage=function(s){ah=this;P=U.extend(true,U.fn.abigimage.defaults,s);this.overlay=ao.attr(P.overlayAttrs).css(P.overlayCSS);this.layout=S.attr(P.layoutAttrs).css(P.layoutCSS);this.box=n.attr(P.boxAttrs).css(P.boxCSS);this.prevBtnWrapper=Y.attr(P.prevBtnWrapperAttrs).css(P.prevBtnWrapperCSS);this.prevBtnBox=G.attr(P.prevBtnBoxAttrs).css(P.prevBtnBoxCSS);this.prevBtn=v.attr(P.prevBtnAttrs).css(P.prevBtnCSS).html(P.prevBtnHtml);this.closeBtnWrapper=B.attr(P.closeBtnWrapperAttrs).css(P.closeBtnWrapperCSS);this.closeBtnBox=O.attr(P.closeBtnBoxAttrs).css(P.closeBtnBoxCSS);this.closeBtn=Z.attr(P.closeBtnAttrs).css(P.closeBtnCSS).html(P.closeBtnHtml);this.img=p.attr(P.imgAttrs).css(P.imgCSS);this.imgNext=z.attr(P.imgNextAttrs).css(P.imgNextCSS);this.imgPrev=ag.attr(P.imgPrevAttrs).css(P.imgPrevCSS);this.bottom=b.attr(P.bottomAttrs).css(P.bottomCSS);var k={};for(var t in P.prevBtnHoverCSS){if(P.prevBtnCSS){k[t]=P.prevBtnCSS[t]}}var d={};for(var t in P.closeBtnHoverCSS){if(P.closeBtnCSS){d[t]=P.closeBtnCSS[t]}}var i={};for(var t in P.bottomHoverCSS){if(P.bottomCSS){i[t]=P.bottomCSS[t]}}this.prevBtnWrapper.hover(function(){v.stop().animate(P.prevBtnHoverCSS,P.fadeIn)},function(){v.stop().animate(k,P.fadeOut)});this.closeBtnWrapper.hover(function(){Z.stop().animate(P.closeBtnHoverCSS,P.fadeIn)},function(){Z.stop().animate(d,P.fadeOut)});this.bottom.hover(function(){b.stop().animate(P.bottomHoverCSS,P.fadeIn)},function(){b.stop().animate(i,P.fadeOut)});return this.each(function(x){U(this).unbind("click.abigimage").bind("click.abigimage",function(){return M(x)})})};U.abigimage={open:M,next:f,prev:Q,close:aj,unbind:I};U.fn.abigimage.defaults={fadeIn:"fast",fadeOut:"fast",slideWidth:0.4,slideVelocity:0.4,zoomMin:1.5,zoomMax:5,prevBtnHtml:"←",closeBtnHtml:"x",keyNext:[13,32,39,40],keyPrev:[8,37,38],keyClose:[27,35,36],onopen:function(){},onclose:function(){},overlayCSS:{position:"fixed",zIndex:101,top:0,right:0,bottom:0,left:0,backgroundColor:"#000",opacity:0.9},layoutCSS:{position:"fixed",zIndex:101,top:0,right:0,bottom:0,left:0,"-webkit-user-select":"none","-moz-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)",lineHeight:2.5},boxCSS:{position:"absolute",width:"312.5%",height:"100%",left:"-106.25%",top:0},prevBtnWrapperCSS:{cursor:"pointer",position:"absolute",top:0,right:"50%",bottom:0,left:0},closeBtnWrapperCSS:{cursor:"pointer",position:"absolute",top:0,right:0,bottom:0,left:"50%"},prevBtnBoxCSS:{position:"absolute",zIndex:103,top:0,bottom:0,left:"68%"},closeBtnBoxCSS:{position:"absolute",zIndex:103,top:0,bottom:0,right:"68%"},prevBtnCSS:{color:"#fff",backgroundColor:"#000",opacity:0.5,padding:"0 1em",borderRadius:"0 0 1ex 0"},closeBtnCSS:{color:"#fff",backgroundColor:"#000",opacity:0.5,padding:"0 1em",borderRadius:"0 0 0 1ex"},prevBtnHoverCSS:{opacity:1},closeBtnHoverCSS:{opacity:1},imgCSS:{position:"absolute",zIndex:102,margin:"auto",width:"auto",top:0,right:0,bottom:0,left:0,display:"block",cursor:"pointer",maxWidth:"32%",maxHeight:"100%"},imgNextCSS:{position:"absolute",margin:"auto",width:"auto",top:0,right:0,bottom:0,left:"68%",display:"block",maxWidth:"32%",maxHeight:"100%"},imgPrevCSS:{position:"absolute",margin:"auto",width:"auto",top:0,right:"68%",bottom:0,left:0,display:"block",maxWidth:"32%",maxHeight:"100%"},bottomCSS:{position:"fixed",zIndex:104,right:0,bottom:0,left:0,"-webkit-user-select":"text","-moz-user-select":"text","user-select":"text",backgroundColor:"#000",color:"#fff",opacity:0.5,padding:"0 1em",textAlign:"center"},bottomHoverCSS:{opacity:1},overlayAttrs:{},layoutAttrs:{},boxAttrs:{},prevBtnWrapperAttrs:{},prevBtnBoxAttrs:{},prevBtnAttrs:{},closeBtnWrapperAttrs:{},closeBtnBoxAttrs:{},closeBtnAttrs:{},imgAttrs:{},imgNextAttrs:{},imgPrevAttrs:{},bottomAttrs:{}}}(jQuery)); \ No newline at end of file diff --git a/index.html b/index.html index c7dbd4c..5c4a5c7 100644 --- a/index.html +++ b/index.html @@ -74,14 +74,14 @@

ABigImage

ABigImage is jQuery plugin for viewing big versions of images.

-

Current version: 1.2.8 (2014-07-24).

+

Current version: 1.3.0 (2015-06-23).

@@ -117,10 +117,10 @@

Features

- + data-ad-slot="1894666116">-->
@@ -263,10 +263,21 @@

Static methods

/* close image */ $.abigimage.close(); + +/* unbind abigimage events */ +$.abigimage.unbind(); +

Changes

+ +
    +
  • 1.3.0 - fixed image caching, added unbind method.
  • +
+ + +

P. S.

I WANT your comments, feature requests, bug reports, suggestions, thoughts... on GitHub.

@@ -277,13 +288,13 @@

P. S.

- - + + - + - - + +