clojurescript - How can I get the DOM element from an Om DIV? -
i using clojurescript om , need access underlying dom element (so can set offsettop 0) on 1 of divs contained in component. how can access element?
you can use get-node
. there example available here.
note component must mounted in order access dom element, therefore should invoke get-node
in 1 of om lifecycle methods invoked after component mounted (e.g. did-mount
).
if using om.next, should use node
function instead.
Comments
Post a Comment