From d7dc7e8243051b6ef972f858e7ed8b411adc2e21 Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Tue, 30 Jun 2015 17:41:13 -0400 Subject: [PATCH] Update the minified version of the file --- contain-element.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contain-element.min.js b/contain-element.min.js index 67dde54..6fb9a2c 100644 --- a/contain-element.min.js +++ b/contain-element.min.js @@ -1 +1 @@ -function containElement(e){function t(){var o=l.parentElement.offsetWidth,a=l.parentElement.offsetHeight;if(o&&a){if(n=o>a/(s*n)*i*n?o/i:a/s,l.style.width=i*n+"px",l.style.height=s*n+"px",i*n>o)switch(e.halign){case"left":l.style.left="0px";break;case"right":l.style.left=0-(i*n-o)+"px";break;default:l.style.left=0-(i*n-o)/2+"px"}else l.style.left="0px";if(s*n>a)switch(e.valign){case"top":l.style.top="0px";break;case"bottom":l.style.top=0-(s*n-a)+"px";break;default:l.style.top=0-(s*n-a)/2+"px"}else l.style.top="0px"}else window.setTimeout(t,30)}var n=1,l=document.getElementById(e.id),i=e.width||l.offsetWidth,s=e.height||l.offsetHeight;"absolute"!=l.style.position&&(l.style.position="absolute"),"hidden"!=l.parentElement.style.overflow&&(l.parentElement.style.overflow="hidden"),"relative"!=l.parentElement.style.position&&"absolute"!=l.parentElement.style.position&&"fixed"!=l.parentElement.style.position&&(l.parentElement.style.position="relative"),t(),window.onresize=function(e){t()},screen.addEventListener("orientationchange",function(){t()})} \ No newline at end of file +function ContainElement(e){function t(){var o=s.parentElement.offsetWidth,p=s.parentElement.offsetHeight;if(o&&p){if(l=o>p/(n*l)*i*l?o/i:p/n,s.style.width=i*l+"px",s.style.height=n*l+"px",i*l>o)switch(e.halign){case"left":s.style.left="0px";break;case"right":s.style.left=0-(i*l-o)+"px";break;default:s.style.left=0-(i*l-o)/2+"px"}else s.style.left="0px";if(n*l>p)switch(e.valign){case"top":s.style.top="0px";break;case"bottom":s.style.top=0-(n*l-p)+"px";break;default:s.style.top=0-(n*l-p)/2+"px"}else s.style.top="0px"}else window.setTimeout(t,30)}var l=1,s=document.getElementById(e.id),i=e.width||s.offsetWidth,n=e.height||s.offsetHeight;"absolute"!=s.style.position&&(s.style.position="absolute"),"hidden"!=s.parentElement.style.overflow&&(s.parentElement.style.overflow="hidden"),"relative"!=s.parentElement.style.position&&"absolute"!=s.parentElement.style.position&&"fixed"!=s.parentElement.style.position&&(s.parentElement.style.position="relative"),t(),this.update=function(){t()}} \ No newline at end of file