1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-03 14:59:18 +02:00

Updated expanding, and resize

This commit is contained in:
Fred Chasen 2015-05-19 00:02:18 -04:00
parent a574c68975
commit 1f7a4a2ccf
9 changed files with 362 additions and 256 deletions

View file

@ -459,4 +459,28 @@ EPUBJS.core.bounds = function(el) {
width: width
}
};
EPUBJS.core.borders = function(el) {
var style = window.getComputedStyle(el);
var widthProps = ["paddingRight", "paddingLeft", "marginRight", "marginLeft", "borderRightWidth", "borderLeftWidth"];
var heightProps = ["paddingTop", "paddingBottom", "marginTop", "marginBottom", "borderTopWidth", "borderBottomWidth"];
var width = 0;
var height = 0;
widthProps.forEach(function(prop){
width += parseFloat(style[prop]) || 0;
})
heightProps.forEach(function(prop){
height += parseFloat(style[prop]) || 0;
})
return {
height: height,
width: width
}
};