I use JavaScript to move an element using the translate function of the -webkit-transform property:
node.style.WebkitTransform = "translate(" + leftPos + "px, 0px)"
The leftPos value leftPos computed at runtime.
In another method, I want to move this node from its current position. This method does not know the value of lastPos .
How can I get the leftPos value from the DOM without tracking it?
One obvious solution is to analyze the value of the property:
node.style.WebkitTransform; // returns "translate(-Xpx, 0px)"
I can make it out, but it does not seem optimal.
source share