diff --git a/README.md b/README.md index 2ded3bd..7bdbe19 100644 --- a/README.md +++ b/README.md @@ -178,7 +178,7 @@ You can also check out the Sproutcore [Automatic Image Scaling demo](http://show ## Size ## -Original Size: 2.81KB gzipped (8.8KB uncompressed) +Original Size: 3.26KB gzipped (10.19KB uncompressed) -Compiled Size: **1.45KB gzipped** (3.52KB uncompressed) +Compiled Size: **1.55KB gzipped** (3.82KB uncompressed) diff --git a/image-scale.jquery.json b/image-scale.jquery.json index a29af8e..85f0b29 100755 --- a/image-scale.jquery.json +++ b/image-scale.jquery.json @@ -10,7 +10,7 @@ "responsive", "resize" ], - "version": "1.2.1", + "version": "1.3", "author": { "name": "GestiXi", "url": "https://github.com/GestiXi" diff --git a/image-scale.js b/image-scale.js index 7cc5512..89fe67a 100755 --- a/image-scale.js +++ b/image-scale.js @@ -3,7 +3,7 @@ // Description: Scale images to fit or fill any target size via two simple properties: scale and align. // Copyright: ©2012-2013 Nicolas BADIA // License: Licensed under the MIT license (see LICENCE) -// Version: 1.2.1 +// Version: 1.3 // ========================================================================== !function($) { "use strict"; diff --git a/image-scale.min.js b/image-scale.min.js index 9f67de3..b1d49b0 100755 --- a/image-scale.min.js +++ b/image-scale.min.js @@ -1,9 +1,9 @@ -/*! image-scale v1.2.1 | ©2012-2013 Nicolas BADIA | Licensed under the MIT license */ -!function(e){e.fn.imageScale=function(d){return this.each(function(){var l=e(this),c=l.data("imageScale");if(c)c.scale();else{l.css("opacity",0);var f=l[0].complete,g=e.extend({},e.fn.imageScale.defaults,"object"==typeof d&&d),a=function(){l.data("imageScale",c=new h(this,g));g.rescaleOnResize&&(window.requestAnimationFrame||e(window).resize(function(a){c.scale()}));c.scale(!0)};f?a.apply(l[0]):l.load(a)}})};e.fn.imageScale.defaults={scale:"best-fill",align:"center",parent:null,hideParentOverflow:!0, -fadeInDuration:0,rescaleOnResize:!0,debug:0};var h=function(d,l){this.options=l;var c=this.$element=e(d);this.elementWidth=c.attr("width")||d.width;this.elementHeight=c.attr("height")||d.height;this.$parent=l.parent?l.parent:e(e(d).parent()[0])};e.fn.imageScale.Constructor=h;h.prototype={NONE:"none",FILL:"fill",BEST_FILL:"best-fill",BEST_FIT:"best-fit",BEST_FIT_DOWN_ONLY:"best-fit-down",ALIGN_LEFT:"left",ALIGN_RIGHT:"right",ALIGN_CENTER:"center",ALIGN_TOP:"top",ALIGN_BOTTOM:"bottom",ALIGN_TOP_LEFT:"top-left", -ALIGN_TOP_RIGHT:"top-right",ALIGN_BOTTOM_LEFT:"bottom-left",ALIGN_BOTTOM_RIGHT:"bottom-right",constructor:h,scale:function(d){var l=this,c=this.$element;window.requestAnimationFrame&&requestAnimationFrame(function(){l.scale()});if(d||this.needUpdate()&&c.is(":visible")){var f=this.options,g=this.$parent,a=g.outerWidth(),k=g.outerHeight(),e=g.innerWidth(),b=g.innerHeight(),e=a-e,b=k-b;scaleData=c.attr("data-scale");alignData=c.attr("data-align");scale=scaleData?scaleData:f.scale;align=alignData?alignData: -f.align;if(scale){this._cacheDestWidth===a&&this._cacheDestHeight===k&&2h?k:h; -break;case this.BEST_FIT:d=kg||f>a?kh?k:h;break;case this.BEST_FIT:b=kf||d>g?k