All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scripts.jQuery.jquery.dimensions-min.js Maven / Gradle / Ivy

(function(d){var a=d.fn.height,c=d.fn.width;d.fn.extend({height:function(){if(this[0]==window){return self.innerHeight||d.boxModel&&document.documentElement.clientHeight||document.body.clientHeight}if(this[0]==document){return Math.max(document.body.scrollHeight,document.body.offsetHeight)}return a.apply(this,arguments)},width:function(){if(this[0]==window){return self.innerWidth||d.boxModel&&document.documentElement.clientWidth||document.body.clientWidth}if(this[0]==document){return Math.max(document.body.scrollWidth,document.body.offsetWidth)}return c.apply(this,arguments)},innerHeight:function(){return this[0]==window||this[0]==document?this.height():this.is(":visible")?this[0].offsetHeight-b(this,"borderTopWidth")-b(this,"borderBottomWidth"):this.height()+b(this,"paddingTop")+b(this,"paddingBottom")},innerWidth:function(){return this[0]==window||this[0]==document?this.width():this.is(":visible")?this[0].offsetWidth-b(this,"borderLeftWidth")-b(this,"borderRightWidth"):this.width()+b(this,"paddingLeft")+b(this,"paddingRight")},outerHeight:function(){return this[0]==window||this[0]==document?this.height():this.is(":visible")?this[0].offsetHeight:this.height()+b(this,"borderTopWidth")+b(this,"borderBottomWidth")+b(this,"paddingTop")+b(this,"paddingBottom")},outerWidth:function(){return this[0]==window||this[0]==document?this.width():this.is(":visible")?this[0].offsetWidth:this.width()+b(this,"borderLeftWidth")+b(this,"borderRightWidth")+b(this,"paddingLeft")+b(this,"paddingRight")},scrollLeft:function(f){if(f!=undefined){return this.each(function(){if(this==window||this==document){window.scrollTo(f,d(window).scrollTop())}else{this.scrollLeft=f}})}if(this[0]==window||this[0]==document){return self.pageXOffset||d.boxModel&&document.documentElement.scrollLeft||document.body.scrollLeft}return this[0].scrollLeft},scrollTop:function(f){if(f!=undefined){return this.each(function(){if(this==window||this==document){window.scrollTo(d(window).scrollLeft(),f)}else{this.scrollTop=f}})}if(this[0]==window||this[0]==document){return self.pageYOffset||d.boxModel&&document.documentElement.scrollTop||document.body.scrollTop}return this[0].scrollTop},position:function(o,j){var g=this[0],m=g.parentNode,i=g.offsetParent,o=d.extend({margin:false,border:false,padding:false,scroll:false},o||{}),l=g.offsetLeft,k=g.offsetTop,h=g.scrollLeft,n=g.scrollTop;if(d.browser.mozilla||d.browser.msie){l+=b(g,"borderLeftWidth");k+=b(g,"borderTopWidth")}if(d.browser.mozilla){do{if(d.browser.mozilla&&m!=g&&d.css(m,"overflow")!="visible"){l+=b(m,"borderLeftWidth");k+=b(m,"borderTopWidth")}if(m==i){break}}while((m=m.parentNode)&&(m.tagName.toLowerCase()!="body"||m.tagName.toLowerCase()!="html"))}var f=e(g,o,l,k,h,n);if(j){d.extend(j,f);return this}else{return f}},offset:function(g,l){var k=0,j=0,t=0,o=0,u=this[0],i=this[0],h,f,s=d.css(u,"position"),r=d.browser.mozilla,m=d.browser.msie,w=d.browser.safari,q=d.browser.opera,n=false,p=false,g=d.extend({margin:true,border:false,padding:false,scroll:true,lite:false},g||{});if(g.lite){return this.offsetLite(g,l)}if(u.tagName.toLowerCase()=="body"){k=u.offsetLeft;j=u.offsetTop;if(r){k+=b(u,"marginLeft")+(b(u,"borderLeftWidth")*2);j+=b(u,"marginTop")+(b(u,"borderTopWidth")*2)}else{if(q){k+=b(u,"marginLeft");j+=b(u,"marginTop")}else{if(m&&jQuery.boxModel){k+=b(u,"borderLeftWidth");j+=b(u,"borderTopWidth")}}}}else{do{f=d.css(i,"position");k+=i.offsetLeft;j+=i.offsetTop;if(r||m){k+=b(i,"borderLeftWidth");j+=b(i,"borderTopWidth");if(r&&f=="absolute"){n=true}if(m&&f=="relative"){p=true}}h=i.offsetParent;if(g.scroll||r){do{if(g.scroll){t+=i.scrollLeft;o+=i.scrollTop}if(r&&i!=u&&d.css(i,"overflow")!="visible"){k+=b(i,"borderLeftWidth");j+=b(i,"borderTopWidth")}i=i.parentNode}while(i!=h)}i=h;if(i.tagName.toLowerCase()=="body"||i.tagName.toLowerCase()=="html"){if((w||(m&&d.boxModel))&&s!="absolute"&&s!="fixed"){k+=b(i,"marginLeft");j+=b(i,"marginTop")}if((r&&!n&&s!="fixed")||(m&&s=="static"&&!p)){k+=b(i,"borderLeftWidth");j+=b(i,"borderTopWidth")}break}}while(i)}var v=e(u,g,k,j,t,o);if(l){d.extend(l,v);return this}else{return v}},offsetLite:function(n,i){var k=0,j=0,g=0,m=0,l=this[0],h,n=d.extend({margin:true,border:false,padding:false,scroll:true},n||{});do{k+=l.offsetLeft;j+=l.offsetTop;h=l.offsetParent;if(n.scroll){do{g+=l.scrollLeft;m+=l.scrollTop;l=l.parentNode}while(l!=h)}l=h}while(l&&l.tagName.toLowerCase()!="body"&&l.tagName.toLowerCase()!="html");var f=e(this[0],n,k,j,g,m);if(i){d.extend(i,f);return this}else{return f}}});var b=function(f,g){return parseInt(d.css(f.jquery?f[0]:f,g))||0};var e=function(j,i,g,k,f,h){if(!i.margin){g-=b(j,"marginLeft");k-=b(j,"marginTop")}if(i.border&&(d.browser.safari||d.browser.opera)){g+=b(j,"borderLeftWidth");k+=b(j,"borderTopWidth")}else{if(!i.border&&!(d.browser.safari||d.browser.opera)){g-=b(j,"borderLeftWidth");k-=b(j,"borderTopWidth")}}if(i.padding){g+=b(j,"paddingLeft");k+=b(j,"paddingTop")}if(i.scroll){f-=j.scrollLeft;h-=j.scrollTop}return i.scroll?{top:k-h,left:g-f,scrollTop:h,scrollLeft:f}:{top:k,left:g}}})(jQuery);




© 2015 - 2024 Weber Informatics LLC | Privacy Policy