(defn
elems->locations
"Returns the location of each elem."
[elems top-offset]
(loop
[i 0 locations (transient [])]
(if-let
[elem (get elems i)]
(let
[top
(-> elem .-offsetTop (- top-offset))
height
(-> elem .-offsetHeight)]
(recur (inc i) (conj! locations {:top top, :height height})))
(persistent! locations))))