forked from incite/jquery-yummi
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjquery.sizes.min.js
8 lines (8 loc) · 1.27 KB
/
jquery.sizes.min.js
1
2
3
4
5
6
7
8
/*
* JSizes - JQuery plugin v0.32
*
* Licensed under the revised BSD License.
* Copyright 2008, Bram Stein
* All rights reserved.
*/
(function(B){var A=function(C){return parseInt(C,10)||0};B.each(["min","max"],function(D,C){B.fn[C+"Size"]=function(G){var F,E;if(G){if(G.width){this.css(C+"-width",G.width)}if(G.height){this.css(C+"-height",G.height)}return this}else{F=this.css(C+"-width");E=this.css(C+"-height");return{width:(C==="max"&&(F===undefined||F==="none"||A(F)===-1)&&Number.MAX_VALUE)||A(F),height:(C==="max"&&(E===undefined||E==="none"||A(E)===-1)&&Number.MAX_VALUE)||A(E)}}}});B.fn.isVisible=function(){return this.css("visibility")!=="hidden"&&this.css("display")!=="none"};B.each(["border","margin","padding"],function(D,C){B.fn[C]=function(E){if(E){if(E.top){this.css(C+"-top"+(C==="border"?"-width":""),E.top)}if(E.bottom){this.css(C+"-bottom"+(C==="border"?"-width":""),E.bottom)}if(E.left){this.css(C+"-left"+(C==="border"?"-width":""),E.left)}if(E.right){this.css(C+"-right"+(C==="border"?"-width":""),E.right)}return this}else{return{top:A(this.css(C+"-top"+(C==="border"?"-width":""))),bottom:A(this.css(C+"-bottom"+(C==="border"?"-width":""))),left:A(this.css(C+"-left"+(C==="border"?"-width":""))),right:A(this.css(C+"-right"+(C==="border"?"-width":"")))}}}})})(jQuery);