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

Анимация: window.getComputedStyle не возвращает значение позиции, если оно в процентах #22

Open
shastox opened this issue Mar 24, 2019 · 0 comments

Comments

@shastox
Copy link

shastox commented Mar 24, 2019

При анимации, вычисляется текущее значение свойства: https://github.com/nolimits4web/dom7/blob/master/src/animate.js#L75

Код пытается разделить значение от единицы измерения, но на практике этот код точно не работает с "процентами", например, ширины, а гугл говорит, что вообще window.getComputedStyle может возвращать только в пикселях позицию.

Вот тут есть пример реализации с эмуляцией разных единиц измерения свойств: http://blog.moagrius.com/javascript/javascript-get-current-style-as-any-unit/

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