Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

offsetWidth and offsetHeight as fourth argument#5

Open
vitorinoninja wants to merge 2 commits into
alexdunphy:masterfrom
vitorinoninja:master
Open

offsetWidth and offsetHeight as fourth argument#5
vitorinoninja wants to merge 2 commits into
alexdunphy:masterfrom
vitorinoninja:master

Conversation

@vitorinoninja

Copy link
Copy Markdown

Hello! Thank you for your module.

I noticed useSelf was false when using those properties as fourth argument:

units.convert("px", "10%", myElement, "offsetWidth")

This was generating wrong results, since the parent offsetWidth can be different (if myElement as visible scroll, in exemple).

At least in all scenarios I am using, this fix made things work properly.
It was fun to read your code and I hope my little change helps somehow!

I noticed useSelf was false when using those properties as fourth argument:
units.convert("px", "10%", myElement, "offsetWidth") 
This was generating wrong results, since the parent offsetWidth can be different (if myElement as visible scroll, in exemple).
At least in all scenarios I am using, this fix made things work properly!
offsetWidth and offsetHeight as fourth argument
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant