You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, thanks for this lib I've just discovered ("Go France", let's be a bit chauvinist!).
I have a draggable element (works perfectly)
This element has a close button (works perfectly with animate())
BUT, every time I click on my close button, BEFORE animate() runs, X/Y position resets to the original one (I want animate() to run from where my element is).
How then to get current position?
close_bookmarklet() {
const bookmarklet = this
animate(bookmarklet, {
keyframes: {
'0%': { transform: 'scale3d(1, 1, 1)' },
...
'100%': { transform: 'scale3d(0, 0, 0)', opacity: '0' }
},
onBegin: (self) => {
// How to get current X/Y position and assign it
},
onComplete: () => {
bookmarklet.remove()
}
})
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
First, thanks for this lib I've just discovered ("Go France", let's be a bit chauvinist!).
close
button (works perfectly withanimate()
)BUT, every time I click on my
close
button, BEFOREanimate()
runs, X/Y position resets to the original one (I wantanimate()
to run from where my element is).How then to get current position?
Thanks for your guidance.
Beta Was this translation helpful? Give feedback.
All reactions