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

Rudimentary support for percentage (%) units #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pastudan
Copy link

@pastudan pastudan commented Aug 8, 2013

I am creating a widget which changes the color of a progress bar depending on it's percentage completion, and need to use this in multiple locations, so I updated the code to support percent widths and heights.

Unfortunately, I have to calculate the percent values from the element and it's parent's height or width, and I can not seem to get them to consistently come out exactly to what they are set to for the element, even if I round up / down.

I have tried using clientWidth and offsetWidth, but these only seem to return integer values. Perhaps someone knows of a better way to calculate percentage of an element?

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

Successfully merging this pull request may close these issues.

None yet

1 participant