Forum Discussion
Arystian-Inglot
7 years agoCommunity Member
[JS] SET OBJECT POSITION
Hello,
is it possible to set an object position (x,y) using javascript when, for example, user clicks the button?
MarcinPaweczak-
2 years agoCommunity Member
A solution using GSAP or TweenLite to reposition elements may be useful. However, it has the feature that changing the page size in the browser (e.g. the F11 key) resets the element's position. Is there any workaround for this problem?
- MathNotermans-92 years agoCommunity Member
Yes. Use a browser event to trigger functions that reset/recalculate the position. Using 'vw' and 'vh' or % instead of pixels also helps.
- MarcinPaweczak-2 years agoCommunity Member
Thank you very much for the tip. Onresize event works, % probably not.
Related Content
- 6 months ago
- 11 months ago