diff --git a/js/jquery.focuspoint.min.js b/js/jquery.focuspoint.min.js new file mode 100644 index 0000000..4011c89 --- /dev/null +++ b/js/jquery.focuspoint.min.js @@ -0,0 +1,7 @@ +/*! + * jQuery FocusPoint; version: 1.0.1 + * Author: http://jonathonmenz.com + * Source: https://github.com/jonom/jquery-focuspoint + * Copyright (c) 2014 J. Menz; MIT License + */ +;(function(a){a.fn.focusPoint=function(b){var c=a.extend({reCalcOnWindowResize:true},b);return this.each(function(){var d=a(this);d.removeClass("focus-left-top focus-left-center focus-left-bottom focus-center-top focus-center-center focus-center-bottom focus-right-top focus-right-center focus-right-bottom");d.adjustFocus();if(c.reCalcOnWindowResize){a(window).resize(function(){d.adjustFocus()})}})};a.fn.adjustFocus=function(){return this.each(function(){var f,n,p,e,l,v,r,u,o,k,d,i,t,x,g,c,j,b,h,s,w,q,m;f=a(this).width();n=a(this).height();p=a(this).find("img").first();e=a(this).data("imageW");l=a(this).data("imageH");if(!(f>0&&n>0&&e>0&&l>0)){return false}v=e/f;r=l/n;if(e>f&&l>n){if(v>r){p.css("max-width","");p.css("max-height","100%")}else{p.css("max-width","100%");p.css("max-height","")}}else{p.css("max-width","");p.css("max-height","")}u=0;o=0;if(v>r){k=Math.floor(f/2);d=(Number(a(this).data("focus-x"))+1)/2;i=Math.floor(e/r);t=Math.floor(d*i);x=t-k;g=i-t;c=f-k;if(g