diff --git a/lib.js b/lib.js index d839e70e..70b83c54 100644 --- a/lib.js +++ b/lib.js @@ -45,4 +45,31 @@ inherits = function (ctor, superCtor) { ctor.super_ = superCtor.prototype; ctor.prototype = new tempCtor(); ctor.prototype.constructor = ctor; -}; \ No newline at end of file +}; + +getInnerWidth = function(element) +{ + return ( + parseInt(computedStyle(element, "paddingLeft")) + + parseInt(computedStyle(element, "paddingRight")) + + element.clientWidth + ); +}; + +getInnerHeight = function(element) +{ + return ( + parseInt(computedStyle(element, "paddingTop")) + + parseInt(computedStyle(element, "paddingBottom")) + + element.clientHeight + ); +}; + +computedStyle = function(element, style) +{ + if (window.getComputedStyle) { + return (window.getComputedStyle(element, null))[style]; + } else { + return element.currentStyle[style]; + } +} \ No newline at end of file