Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It fails to read offsetWidth and offsetHeight when widht/height of element is set in percentage #28

Open
aichi opened this issue Feb 2, 2011 · 0 comments

Comments

@aichi
Copy link

aichi commented Feb 2, 2011

When widht/height of element is set in percentage like 100% then enviroment methods offsetWidth and offsetHeight return NaN. We quick fix it like:

get offsetHeight(){
return Math.ceil(parseInt(this.style.height) || 1);
},
get offsetWidth(){
return Math.ceil(parseInt(this.style.width) || 1);
}

file: html.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant