moving an element in JS
To move an element by changing it’s top value, the element can’t have a static position (the default). You’ll need to change the position to absolute, relative, fixed, etc…. Get the current top, left, etc… using Element#getBoundingClientRect, which will give you the correct initial value, and save you the need to parse a string. Since top needs to have a unit (px, em, … Read more